home *** CD-ROM | disk | FTP | other *** search
/ Windows Expert / Windows Expert.iso / utility / cmdp72d.zip / CMDPOST.MA$ < prev    next >
Text File  |  1992-02-26  |  218KB  |  8,837 lines

  1.  
  2.  
  3.  
  4.  
  5.                                                            Command Post 7.0
  6.                                                               User's Manual
  7.  
  8.  
  9.  
  10.                                                                   31-May-90
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.                                 For IBM, PC/XT, PC/AT, PS/2 and compatibles
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.                                                           Wilson WindowWare
  36.                                             2701 California Ave SW  ste 212
  37.                                                           Seattle, WA 98116
  38.  
  39.  
  40.                                                       Orders:(800) 762-8383
  41.                                                    Support:  (206) 937-9335
  42.                                                       Fax:   (206) 935-7129
  43.  
  44.  
  45.  
  46.  
  47.                          Copyright 1988-1990 by Morrie Wilson.
  48.                                   All rights reserved.
  49.  
  50.  
  51.  
  52.           No part of this manual may be reproduced or transmitted in any
  53.           form or by any means, electronic or mechanical, including
  54.           photocopying and recording, for any purpose without the express
  55.           written permission of Wilson WindowWare.  Information in this
  56.           document is subject to change without notice and does not
  57.           represent a commitment by Wilson WindowWare.
  58.  
  59.  
  60.           The software described herein is furnished under a license
  61.           agreement.  It is against the law to copy this software under any
  62.           circumstances except as provided by the license agreement.
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.           U.S. Government Restricted Rights
  73.           Use, duplication, or disclosure by the Government is subject to
  74.           restrictions as set forth in subdivision (b)(3)(ii) of the Rights
  75.           in Technical Data and Computer Software clause at 252.227-7013.
  76.           Contractor/manufacturer is Wilson WindowWare/2701 California Ave SW
  77.           /ste 212/Seattle, WA 98116
  78.  
  79.  
  80.  
  81.           Trademarks
  82.           IBM, PC/XT, PC/AT, and PS/2 are registered trademarks of
  83.           International Business Machines Corporation.
  84.           Microsoft and MS-DOS are registered trademarks of Microsoft
  85.           Corporation.
  86.           Windows is a trademark of Microsoft Corporation.
  87.           PageMaker is a trademark of Aldus Corporation.
  88.           PubTech and BatchWorks are registered trademarks of Publishing
  89.           Technologies, Inc.
  90.  
  91.           JELL-O is  a registered trademark of General Foods Corporation.
  92.  
  93.           Command Post is a trademark of Wilson WindowWare.
  94.  
  95.  
  96.  
  97.  
  98.                                                                             ii
  99.  
  100.                                                                       CONTENTS
  101.  
  102.  
  103.                                         CONTENTS
  104.  
  105.  
  106.           CONTENTS                           iii
  107.  
  108.           INTRODUCTION                         v
  109.              System Requirements               v
  110.              About This Manual                 v
  111.              Notational Conventions            v
  112.              Acknowledgements                 vi
  113.  
  114.           GETTING STARTED                      1
  115.  
  116.           TEN-MINUTE TOUR                      3
  117.              Selecting and navigating          4
  118.              File Management                   6
  119.              Directory Management             12
  120.              Changing the View                14
  121.              Housekeeping Functions           16
  122.                Edit System Configuration...   20
  123.              System Menu Box                  21
  124.              The Command Post Clock           23
  125.  
  126.           YOUR OWN MENUS                      25
  127.              What is a Menu File?             25
  128.              How to Create a Simple Menu      25
  129.              Enhancing Our Menu               26
  130.              An Enhancement for Safety        27
  131.              The Major Functions              28
  132.                Running a Program              28
  133.                Getting Info from the User     29
  134.                Displaying Information         30
  135.                Other Useful Functions         31
  136.  
  137.           COMMAND POST MENU LANGUAGE          35
  138.              Menu Structure                   35
  139.              Menu Items                       35
  140.              Language Components              36
  141.                Constants                      36
  142.                Identifiers                    37
  143.                Variables                      37
  144.                Keywords Are Reserved          38
  145.                Operators                      38
  146.            Precedence and eval order      39
  147.                Comments                       39
  148.                Statements                     39
  149.                Substitution                   40
  150.                Language Directives            41
  151.              Function Parameters              41
  152.              Error Handling                   41
  153.  
  154.                                                                            iii
  155.  
  156.                                                                       CONTENTS
  157.  
  158.              The Functions & Statements       42
  159.                Inputting Information          42
  160.                Displaying Information         42
  161.                File Management                42
  162.                Directory Management           43
  163.                Disk Drive Management          43
  164.                Window Management              43
  165.                Menu Management                44
  166.                Program Management             44
  167.                String Handling                45
  168.                Arithmetic Functions           45
  169.                Clipboard Handling             46
  170.                System Control                 46
  171.  
  172.           CPML FUNCTION REFERENCE             51
  173.              Introduction                     51
  174.              Abs                              52
  175.              TextBox                         128
  176.              Version                         129
  177.              WinClose                        132
  178.  
  179.           APPENDIX A  Browser                146
  180.  
  181.           APPENDIX B  CmdPost and Win 3.0    149
  182.              Command Post as Your Shell      149
  183.  
  184.           APPENDIX C  Programming Tricks     151
  185.              Fun With Filenames              151
  186.              Making a Free-Floating Menu     152
  187.              Program is Already Running      152
  188.              Working With Lists              152
  189.              Conditional Branching           153
  190.              The Command Post Clock          154
  191.  
  192.           APPENDIX D  Predefined Constants   155
  193.  
  194.           APPENDIX E  Errors                 157
  195.              Minor Errors                    157
  196.              Moderate Errors                 157
  197.              Fatal Errors                    158
  198.  
  199.           Index                              160
  200.  
  201.  
  202.  
  203.  
  204.  
  205.  
  206.  
  207.  
  208.  
  209.  
  210.                                                                             iv
  211.  
  212.                                                                   INTRODUCTION
  213.  
  214.  
  215.                                       INTRODUCTION
  216.  
  217.           Command Post 7.0 helps you end some of the drudgery of day-to-day
  218.           tasks when working in Microsoft Windows.
  219.  
  220.           How many times have we tired of changing drives, moving through two
  221.           subdirectories, finding an executable file from among 43 other
  222.           filenames, double clicking on it, selecting File/Open, then
  223.           searching for another directory in the listbox because our document
  224.           happens to be in a different directory than the program!  With
  225.           Command Post you can automate that knowledge of where to move
  226.           around the disk, which directories to go to, which files you want
  227.           to work on, what size you prefer your window to be, and so on.
  228.  
  229.  
  230.           System Requirements
  231.           Command Post 7.0 requires an IBM PC or compatible with a minimum of
  232.           640k memory running Microsoft Windows version 2.03 or higher.
  233.  
  234.  
  235.  
  236.           About This Manual
  237.           This manual is divided into five sections:  First is Getting
  238.           Started (pg. 1), where we tell you how to install the program.
  239.           Then we offer a Ten-Minute Tour of the default File Manager window
  240.           (pg. 3).  Next is an introduction to creating Your Own Menus (pg.
  241.           25), after which you can start making your own individual routine
  242.           easier.
  243.           Then we go into a full description of the Command Post Menu
  244.           Language (CPML) (pg. 33), and a comprehensive CPML Function
  245.           Reference (pg. 47) to assist you in making more complex and
  246.           intelligent menus.
  247.  
  248.  
  249.  
  250.           Notational Conventions
  251.           Throughout this manual, we use the following conventions to
  252.           distinguish elements of text:
  253.           ALL-CAPS
  254.              Used for filenames.
  255.  
  256.           Boldface
  257.              Used for important points, programs, function names, and parts of
  258.              syntax that must appear as shown.
  259.           System
  260.              Used for menu names as they appear to the user.
  261.  
  262.           Small fixed-width
  263.              Used for menu program sample code.
  264.  
  265.  
  266.                                                                              v
  267.  
  268.                                                                   INTRODUCTION
  269.  
  270.           Acknowledgements
  271.           Command Post 7.0 designed & written by Morrie Wilson.
  272.           Additional programming by Michael Davis & Jennifer Palonus.
  273.           User's Manual designed by Jennifer Palonus.
  274.           Written by Jennifer Palonus & Morrie Wilson.
  275.  
  276.           Our thanks to the many beta-testers for their invaluable comments &
  277.           suggestions.
  278.  
  279.  
  280.  
  281.  
  282.  
  283.  
  284.  
  285.  
  286.  
  287.  
  288.  
  289.  
  290.  
  291.  
  292.  
  293.  
  294.  
  295.  
  296.  
  297.  
  298.  
  299.  
  300.  
  301.  
  302.  
  303.  
  304.  
  305.  
  306.  
  307.  
  308.  
  309.  
  310.  
  311.  
  312.  
  313.  
  314.  
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.                                                                             vi
  323.  
  324.                                                               GETTING  STARTED
  325.  
  326.  
  327.                                         GETTING
  328.                                         STARTED
  329.  
  330.           Command Post is quite easy to install.  You will find an
  331.           appropriate diskette in your Command Post package.  Take the
  332.           diskette and insert it into your floppy drive.  The Command Post
  333.           installation program is itself a Windows application, so make sure
  334.           Windows is running.
  335.  
  336.           If you are in Windows version 2.03 or 2.11:
  337.           From the MS-DOS Executive, click on the A: or B: drive icon,
  338.           depending on which floppy drive you used.  A directory listing will
  339.           appear for the Command Post diskette.  Doubleclick on the filename
  340.           INSTALL.EXE.  Follow whatever instructions Install gives you.
  341.  
  342.           If you are in Windows version 3.0:
  343.           From the Program Manager, doubleclick on the File Manager icon to
  344.           run it.  When File Manager starts, click on the A: or B: drive
  345.           icon, depending on which floppy drive you used.  A directory tree
  346.           will appear for the Command Post diskette.  You should see a root
  347.           directory icon.  Doubleclick on this icon and a list of filenames
  348.           will appear.  Find the filename INSTALL.EXE and doubleclick on it.
  349.           Follow whatever instructions Install gives you.
  350.  
  351.           Either Version:
  352.           Install will create the necessary files and place them into a
  353.           directory it will prompt you for.  If Command Post is already run-
  354.           ning it will close it down it before trying to copy the new program
  355.           file over the old one.
  356.  
  357.           As the installation program finishes it will display the #READ-
  358.           ME.1ST file.  You should take the time to read this file as it
  359.           contains any late-breaking information about your copy of Command
  360.           Post.
  361.  
  362.  
  363.  
  364.  
  365.  
  366.  
  367.  
  368.  
  369.  
  370.  
  371.  
  372.  
  373.  
  374.  
  375.  
  376.  
  377.  
  378.                                                                              1
  379.  
  380.                                                                TEN-MINUTE TOUR
  381.  
  382.  
  383.                                     TEN-MINUTE TOUR
  384.  
  385.           Command Post starts up in a window with a listing of the current
  386.           directory and a menu across the top.  All Command Post menus are
  387.           completely customizable, and defined in a separate "menu file".
  388.           We've included a default menu file CMDPOST.CPM that creates a menu
  389.           similar to the Windows 2.x MS-DOS Executive, with some improve-
  390.           ments.  This is what you get if you run Command Post without
  391.           specifying a menu file.
  392.  
  393.           After the default menu, you may see custom menu items that have
  394.           been defined in a second menu file.  Command Post's default menu
  395.           file calls the file CMDUSER.CPM to get you started:
  396.  
  397.  
  398.  
  399.  
  400.  
  401.  
  402.  
  403.  
  404.  
  405.  
  406.  
  407.  
  408.  
  409.  
  410.  
  411.  
  412.  
  413.  
  414.           The Command Post window shows your disk drives, the current
  415.           directory's path, and the filenames and subdirectories in the
  416.           current directory.
  417.  
  418.  
  419.  
  420.  
  421.  
  422.  
  423.  
  424.  
  425.  
  426.  
  427.  
  428.  
  429.  
  430.  
  431.  
  432.  
  433.  
  434.  
  435.  
  436.                                                                            155
  437.  
  438.                                                                TEN-MINUTE TOUR
  439.  
  440.           Selecting and navigating
  441.  
  442.             Action       Mouse          Keyboard
  443.                     Click on         Type Ctrl +
  444.           Select a  directory icon   desired drive
  445.           Drive     with the left    letter.
  446.                     button.
  447.       ________
  448.                     Click on         Use arrow keys
  449.           Select a  desired          to place
  450.           File      filename with    selection box
  451.                     left button.     over desired
  452.                                      file.
  453.                                      OR:  Press
  454.                                      first letter of
  455.                                      filename to
  456.                                      move selection
  457.                                      box to next
  458.                                      file with that
  459.                                      letter.
  460.       ________
  461.                     Click on         Press the Shift
  462.           Select    additional       key while
  463.           Addn'l    filenames with   moving
  464.           Files     the left button  selection box
  465.                     while pressing   over a range of
  466.                     the Shift key.   filenames.
  467.                     OR:  Click on    Press the Ctrl
  468.                     additional       key while
  469.                     filenames with   moving
  470.                     the right        selection box
  471.                     button.          over filenames
  472.                                      you don't want
  473.                     OR:  Drag mouse  to select.
  474.                     over a group of
  475.                     additional
  476.                     filenames with
  477.                     the right
  478.       ________  button pressed.
  479.                     Doubleclick on   Place selection
  480.           Run a     desired .EXE     box over
  481.           Program   filename.        desired program
  482.                                      or datafile and
  483.                     OR:              press Enter.
  484.                     Doubleclick on
  485.                     datafile name
  486.                     if it has an
  487.                     [extensions]
  488.                     association in
  489.                     WIN.INI
  490.  
  491.  
  492.                                                                              4
  493.  
  494.                                                                TEN-MINUTE TOUR
  495.  
  496.                     Same as running  Same as running
  497.           Load an   a program,       a program,
  498.           Icon      except press     except press
  499.                     the Shift key    Shift+Enter.
  500.                     while clicking
  501.       ________  the filename.
  502.                     Doubleclick on   Place selection
  503.           Go to a   desired subdir-  box over
  504.           Subdirec- ectory name      desired
  505.           tory      with the left    directory and
  506.                     button.          press Enter.
  507.       ________
  508.                     Click on         Press the
  509.           Go to a   desired          Backspace key.
  510.           Parent    directory in
  511.           Directory the current
  512.                     path string
  513.                     (next to the
  514.                     drive icons)
  515.                     with the left
  516.                     button.
  517.  
  518.  
  519.  
  520.  
  521.  
  522.  
  523.  
  524.  
  525.  
  526.  
  527.  
  528.  
  529.  
  530.  
  531.  
  532.  
  533.  
  534.  
  535.  
  536.  
  537.  
  538.  
  539.  
  540.  
  541.  
  542.  
  543.  
  544.  
  545.  
  546.  
  547.  
  548.                                                                              5
  549.  
  550.                                                                TEN-MINUTE TOUR
  551.  
  552.           Let's look at the default menu items:
  553.  
  554.  
  555.           File Management
  556.  
  557.  
  558.  
  559.  
  560.  
  561.  
  562.  
  563.  
  564.  
  565.  
  566.  
  567.  
  568.  
  569.  
  570.  
  571.  
  572.  
  573.  
  574.  
  575.  
  576.  
  577.  
  578.           Run...
  579.           Load...
  580.           These selections launch a pro-
  581.           gram.  Run... starts it as a
  582.           "normal" window, i.e. not full-
  583.           screen.  Load... starts the
  584.           program as an icon.
  585.  
  586.  
  587.  
  588.  
  589.           In either case a dialog box is displayed asking you for the name of
  590.           the file you want to start.  Whichever file is currently highlight-
  591.           ed in the directory listing is the default.
  592.  
  593.  
  594.           Browse
  595.           This menu item runs the Command Post Browser program to view the
  596.           selected file.  This program lets you view the file in a variety of
  597.           ways.
  598.           The default is to show the file in Windows' "ANSI text" mode:
  599.  
  600.  
  601.  
  602.  
  603.  
  604.                                                                              6
  605.  
  606.                                                                TEN-MINUTE TOUR
  607.  
  608.  
  609.  
  610.  
  611.  
  612.  
  613.  
  614.  
  615.  
  616.  
  617.  
  618.  
  619.  
  620.  
  621.  
  622.                             Initial Browser View - ANSI Text
  623.  
  624.           You can also view the file as "ASCII text", which interprets some
  625.           special characters differently:
  626.  
  627.  
  628.  
  629.  
  630.  
  631.  
  632.  
  633.  
  634.  
  635.  
  636.  
  637.  
  638.  
  639.  
  640.  
  641.                                   Options/ASCII text
  642.           Browser gives you the ability to filter which lines you view with
  643.           its Hide & Seek commands.  You can hide or show specific lines by
  644.           entering a word to look for.
  645.  
  646.           For instance, the menu item Hide & Seek/Show if... displays this
  647.           dialog box:
  648.  
  649.  
  650.  
  651.  
  652.  
  653.  
  654.  
  655.  
  656.  
  657.  
  658.           ...and (in this example) shows only the lines containing the word
  659.           "modem":
  660.                                                                              7
  661.  
  662.                                                                TEN-MINUTE TOUR
  663.  
  664.  
  665.  
  666.  
  667.  
  668.  
  669.  
  670.  
  671.  
  672.  
  673.  
  674.  
  675.  
  676.  
  677.  
  678.           You can also view a file in hexadecimal format:
  679.  
  680.  
  681.  
  682.  
  683.  
  684.  
  685.  
  686.  
  687.  
  688.  
  689.  
  690.  
  691.  
  692.  
  693.  
  694.                                     Options/Hex dump
  695.  
  696.  
  697.           A comprehensive discussion of the Command Post Browser program can
  698.           be found in Appendix A -- Browser (pg. 142 ).
  699.  
  700.  
  701.           Copy...
  702.           This menu item lets you copy the selected files to another
  703.           filename, directory, or drive.  A dialog box appears for you to
  704.           specify the destination pathname.  The default is the current
  705.           directory.
  706.  
  707.  
  708.  
  709.  
  710.  
  711.  
  712.  
  713.  
  714.  
  715.  
  716.                                                                              8
  717.  
  718.                                                                TEN-MINUTE TOUR
  719.  
  720.  
  721.  
  722.  
  723.  
  724.  
  725.  
  726.  
  727.  
  728.  
  729.  
  730.  
  731.           Rename/Move...
  732.           This selection lets you rename the selected files to another name,
  733.           or to move them to another directory or drive.  If you are moving
  734.           files you may rename them in the process.
  735.  
  736.  
  737.  
  738.  
  739.  
  740.  
  741.  
  742.  
  743.  
  744.  
  745.  
  746.  
  747.  
  748.           Delete File...
  749.           This menu item lets you delete the selected files.  A dialog box
  750.           will appear to confirm you really want to delete them.
  751.  
  752.  
  753.  
  754.  
  755.  
  756.  
  757.  
  758.  
  759.  
  760.           Print...
  761.           This copies the selected file to any standard non-postscript
  762.           printer.  It prompts you for the device to print to.
  763.  
  764.           This command is meant to be used with text files only; it doesn't
  765.           attempt to format the file or otherwise interpret it.
  766.  
  767.  
  768.  
  769.  
  770.  
  771.  
  772.                                                                              9
  773.  
  774.                                                                TEN-MINUTE TOUR
  775.  
  776.  
  777.  
  778.  
  779.           Size of selected files
  780.           This menu item displays a
  781.           message box showing you how much
  782.           space is taken up by the
  783.           selected files:
  784.  
  785.  
  786.  
  787.  
  788.  
  789.  
  790.  
  791.  
  792.  
  793.  
  794.  
  795.  
  796.  
  797.  
  798.  
  799.  
  800.  
  801.  
  802.  
  803.  
  804.  
  805.  
  806.  
  807.  
  808.  
  809.  
  810.  
  811.  
  812.  
  813.  
  814.  
  815.  
  816.  
  817.  
  818.  
  819.  
  820.  
  821.  
  822.  
  823.  
  824.  
  825.  
  826.  
  827.  
  828.                                                                             10
  829.  
  830.                                                                TEN-MINUTE TOUR
  831.  
  832.  
  833.           Freespace on drives
  834.           This menu displays a message box
  835.           showing you how much space is
  836.           available on your hard drives:
  837.  
  838.  
  839.  
  840.  
  841.  
  842.  
  843.  
  844.  
  845.           Space on A and size of files
  846.           Space on B and size of files
  847.           These commands display message
  848.           boxes showing you how much space
  849.           is taken up by the selected
  850.           files vs. how much space is
  851.           available on your floppy drives:
  852.  
  853.  
  854.  
  855.           These menu selections are especially useful when you are preparing
  856.           to copy files to a floppy disk and want to know if you have enough
  857.           space to receive the files.
  858.  
  859.  
  860.           Extensions...
  861.           Windows gives you the ability to double-click on a data filename
  862.           and automatically run a program with it based on the data file's
  863.           extension.  For instance you can doubleclick on a .CRD file and the
  864.           Cardfile program will pop up and load the file you chose.  The
  865.           "association" between .CRD files and the Cardfile program is stored
  866.           in the [extensions] section of the WIN.INI file.
  867.           The File/Extensions... menu displays a dialog box allowing you to
  868.           add or change the association between the selected file's extension
  869.           and a program.  If you change the association line the new
  870.           relationship will be recorded in the WIN.INI file.
  871.  
  872.           The next time you doubleclick on the file (or any other file with
  873.           that extension), the associated program will be run with it.  This
  874.           is much simpler than bringing up Notepad and editing the WIN.INI
  875.           file to change the association.
  876.  
  877.           Exit Windows
  878.           This menu item ends your Windows session.  It has the same effect
  879.           as choosing File/Exit in the MS-DOS Executive screen in Windows
  880.           version 2.11 or closing the Program Manager in Windows v3.0.
  881.  
  882.  
  883.  
  884.                                                                             11
  885.  
  886.                                                                TEN-MINUTE TOUR
  887.  
  888.           Directory Management
  889.  
  890.  
  891.  
  892.  
  893.  
  894.  
  895.  
  896.  
  897.  
  898.           Create Directory...
  899.           This menu item lets you create a subdirectory under the current
  900.           one:
  901.  
  902.  
  903.  
  904.  
  905.  
  906.  
  907.  
  908.  
  909.  
  910.  
  911.  
  912.  
  913.           Delete Directory...
  914.           This menu item lets you delete a subdirectory of the current one:
  915.  
  916.  
  917.  
  918.  
  919.  
  920.  
  921.  
  922.  
  923.  
  924.           Change Directory...
  925.           This selection changes the current directory to one you specify:
  926.  
  927.  
  928.  
  929.  
  930.  
  931.  
  932.  
  933.  
  934.  
  935.  
  936.  
  937.  
  938.  
  939.  
  940.                                                                             12
  941.  
  942.                                                                TEN-MINUTE TOUR
  943.  
  944.           You can also change directories by doubleclicking on a subdirectory
  945.           name, clicking on the pathname above the file listing, or pressing
  946.           backspace to go back up to the parent directory.
  947.  
  948.           Format Diskette...
  949.           This selection formats a
  950.           diskette in one of your floppy
  951.           drives by calling the MS-DOS
  952.           Format program.
  953.  
  954.           The first time you choose Format
  955.           Diskette... after installing
  956.           Command Post, you are asked what
  957.           kind of floppy drives your
  958.           system has.  Command Post saves
  959.           this information in the WIN.INI
  960.           file for the next time you
  961.           choose Format Diskette... .
  962.  
  963.  
  964.  
  965.  
  966.  
  967.  
  968.  
  969.  
  970.  
  971.  
  972.  
  973.  
  974.  
  975.  
  976.  
  977.  
  978.  
  979.  
  980.  
  981.  
  982.  
  983.  
  984.  
  985.  
  986.  
  987.  
  988.  
  989.  
  990.  
  991.  
  992.  
  993.  
  994.  
  995.  
  996.                                                                             13
  997.  
  998.                                                                TEN-MINUTE TOUR
  999.  
  1000.  
  1001.           Directory Tree
  1002.           When you select the
  1003.           Dir/Directory Tree menu item, a
  1004.           window is displayed which
  1005.           graphically shows the directory
  1006.           structure of the current drive.
  1007.           You can scroll through the
  1008.           structure, and then click on the
  1009.           directory you want to change to.
  1010.           If you click on a directory with
  1011.           the right button, a whole new
  1012.           Command Post window appears with
  1013.           that directory listed.
  1014.  
  1015.           You can also change the current
  1016.           disk drive by selecting Disks
  1017.           from the directory tree window.
  1018.  
  1019.  
  1020.  
  1021.  
  1022.  
  1023.  
  1024.           Changing the View
  1025.  
  1026.  
  1027.  
  1028.  
  1029.  
  1030.  
  1031.  
  1032.  
  1033.  
  1034.  
  1035.  
  1036.  
  1037.  
  1038.  
  1039.  
  1040.  
  1041.  
  1042.  
  1043.  
  1044.  
  1045.  
  1046.  
  1047.  
  1048.  
  1049.  
  1050.  
  1051.  
  1052.                                                                             14
  1053.  
  1054.                                                                TEN-MINUTE TOUR
  1055.  
  1056.           Short
  1057.           Long
  1058.           View/Short displays only the filenames, while View/Long also
  1059.           displays the size, and date & time modified.
  1060.  
  1061.           All
  1062.           Partial...
  1063.           Programs
  1064.           These selections determine which
  1065.           filenames are shown.  All
  1066.           displays all files in the
  1067.           current directory.  Partial...
  1068.           displays a dialog box where you
  1069.           specify one or more wildcarded
  1070.           filenames to show:
  1071.  
  1072.  
  1073.  
  1074.           Selecting Programs shows only those files with an extension of
  1075.           .BAT, .COM, .EXE, or .PIF.
  1076.  
  1077.           By Name,   By Date,   By Size,   By Kind,   Unsorted
  1078.           These selections specify how to sort the files in the display.  The
  1079.           default is to sort by Name.
  1080.  
  1081.           Sorting by Date shows the most-recently modified files before the
  1082.           older ones.  Sorting by Size shows the largest files first.
  1083.           Sorting by Kind displays the files by their extensions.  Unsorted
  1084.           produces a list in the same order as you would get from a dir
  1085.           listing in MSDOS.
  1086.  
  1087.           Window Arranging
  1088.           The right column of the View menu contains the window arranging
  1089.           functions.  There are four ways Command Post can arrange
  1090.           application windows on the screen for you:
  1091.  
  1092.  
  1093.  
  1094.  
  1095.  
  1096.  
  1097.  
  1098.  
  1099.  
  1100.  
  1101.  
  1102.                              1 Stack             2 Arrange
  1103.  
  1104.  
  1105.  
  1106.  
  1107.  
  1108.                                                                             15
  1109.  
  1110.                                                                TEN-MINUTE TOUR
  1111.  
  1112.  
  1113.  
  1114.  
  1115.  
  1116.  
  1117.  
  1118.  
  1119.  
  1120.  
  1121.  
  1122.                        3 Arrange in Rows     4 Arrange in Columns
  1123.  
  1124.           Selections 5 through 8 are the same as 1 through 4 except the
  1125.           Command Post window is minimized.
  1126.  
  1127.           When you specify Arrange in Rows and you have more than four open
  1128.           windows, or if you specify Arrange in Columns and there are more
  1129.           than three open windows, Command Post will revert to Arrange.
  1130.  
  1131.  
  1132.           Housekeeping Functions
  1133.  
  1134.  
  1135.  
  1136.  
  1137.  
  1138.  
  1139.  
  1140.  
  1141.  
  1142.  
  1143.  
  1144.  
  1145.  
  1146.  
  1147.  
  1148.  
  1149.  
  1150.  
  1151.  
  1152.  
  1153.           Command Post
  1154.           You can launch a second copy of Command Post while the first is
  1155.           running.  This way you can view more than one directory at a time.
  1156.           Also, when you choose File/Copy... or File/Rename/Move..., the
  1157.           destination pathname defaults to the "other" Command Post's
  1158.           directory.
  1159.  
  1160.  
  1161.           Control Panel
  1162.           This selection runs the Windows Control Panel:
  1163.  
  1164.                                                                             16
  1165.  
  1166.                                                                TEN-MINUTE TOUR
  1167.  
  1168.  
  1169.  
  1170.  
  1171.  
  1172.  
  1173.  
  1174.  
  1175.  
  1176.  
  1177.  
  1178.  
  1179.  
  1180.                                Windows 2.11 Control Panel
  1181.  
  1182.  
  1183.  
  1184.  
  1185.  
  1186.  
  1187.  
  1188.  
  1189.                                Windows 3.0 Control Panel
  1190.  
  1191.  
  1192.           Clipboard
  1193.           This menu item runs the Windows
  1194.           Clipboard viewer:
  1195.  
  1196.  
  1197.  
  1198.  
  1199.  
  1200.  
  1201.  
  1202.  
  1203.  
  1204.  
  1205.  
  1206.           DOS Prompt
  1207.           This selection runs COMMAND.COM to enable you to work in DOS
  1208.           directly.  You can press ALT+ESC to switch back and forth between
  1209.           Windows and DOS, and when you are through using the command-line
  1210.           interface you type "exit" from the DOS prompt to return to Windows.
  1211.  
  1212.           Get Help Cardfile
  1213.           This menu item runs Cardfile with the handy Command Post help file.
  1214.           This gives you a quick reference to all the Command Post Menu
  1215.           Language (CPML) functions and statements.
  1216.  
  1217.  
  1218.  
  1219.  
  1220.                                                                             17
  1221.  
  1222.                                                                TEN-MINUTE TOUR
  1223.  
  1224.           Reset Options...
  1225.           This menu item lets you change the screen-blanker time, default
  1226.           File/Print... printer device, and installed-disk drive options.
  1227.  
  1228.           System Information
  1229.           This selection shows a message
  1230.           box containing numerous pieces
  1231.           of information about your
  1232.           Windows installation.
  1233.  
  1234.  
  1235.  
  1236.  
  1237.  
  1238.  
  1239.  
  1240.  
  1241.  
  1242.  
  1243.  
  1244.  
  1245.  
  1246.  
  1247.           Program Manager
  1248.           This selection calls up the Windows 3.0 Program Manager.
  1249.  
  1250.  
  1251.           File Manager
  1252.           This selection invokes the Windows 3.0 File Manager.
  1253.  
  1254.           Print Manager
  1255.           This selection runs Windows 3.0 Print Manager.
  1256.  
  1257.  
  1258.           Windows Setup
  1259.           This menu item runs the Windows 3.0 Setup program.  This lets you
  1260.           review your current Windows setup configuration and change it if
  1261.           necessary.
  1262.  
  1263.           Edit Command Post Menus
  1264.           This menu item displays a listbox containing all the .CPM files in
  1265.           the current directory:
  1266.  
  1267.  
  1268.  
  1269.  
  1270.  
  1271.  
  1272.  
  1273.  
  1274.  
  1275.  
  1276.                                                                             18
  1277.  
  1278.                                                                TEN-MINUTE TOUR
  1279.  
  1280.  
  1281.  
  1282.  
  1283.  
  1284.  
  1285.  
  1286.  
  1287.  
  1288.  
  1289.  
  1290.  
  1291.  
  1292.  
  1293.  
  1294.  
  1295.  
  1296.  
  1297.           It then starts the Windows Notepad with the .CPM file you chose:
  1298.  
  1299.  
  1300.  
  1301.  
  1302.  
  1303.  
  1304.  
  1305.  
  1306.  
  1307.  
  1308.  
  1309.  
  1310.  
  1311.  
  1312.  
  1313.  
  1314.  
  1315.  
  1316.  
  1317.  
  1318.           In order to actually use the updated menu file you must select
  1319.           Reload Menu from Command Post's system-box menu.
  1320.  
  1321.  
  1322.  
  1323.  
  1324.  
  1325.  
  1326.  
  1327.  
  1328.  
  1329.  
  1330.  
  1331.  
  1332.                                                                             19
  1333.  
  1334.                                                                TEN-MINUTE TOUR
  1335.  
  1336.  
  1337.           Edit INI Files
  1338.           This menu item lets you edit a
  1339.           Windows initialization file.
  1340.           If you are using Windows v3.0
  1341.           you must keep track of multiple
  1342.           .INI files.  You will see a
  1343.           listbox containing all the .INI
  1344.           files in the current directory:
  1345.  
  1346.  
  1347.  
  1348.  
  1349.  
  1350.  
  1351.  
  1352.  
  1353.           It then starts the Windows Notepad with the .INI file you chose:
  1354.  
  1355.  
  1356.  
  1357.  
  1358.  
  1359.  
  1360.  
  1361.  
  1362.  
  1363.  
  1364.  
  1365.  
  1366.  
  1367.  
  1368.  
  1369.  
  1370.  
  1371.  
  1372.  
  1373.           If you are running Windows v2.11 there is only one initialization
  1374.           file, WIN.INI, so you will be put directly into Notepad when
  1375.           selecting the menu.
  1376.  
  1377.  
  1378.           Edit System Configuration...
  1379.           This selection runs the Windows 3.0 System Editor.  The System
  1380.           Editor allows you to edit the AUTOEXEC.BAT, CONFIG.SYS, WIN.INI,
  1381.           and SYSTEM.INI files.
  1382.  
  1383.           This menu item is disabled if you are running Windows 2.x.
  1384.  
  1385.  
  1386.  
  1387.  
  1388.                                                                             20
  1389.  
  1390.                                                                TEN-MINUTE TOUR
  1391.  
  1392.           System Menu Box
  1393.           We've made some changes to the system menu box at the upper-left
  1394.           corner of the Command Post window.
  1395.  
  1396.  
  1397.  
  1398.  
  1399.  
  1400.  
  1401.  
  1402.  
  1403.  
  1404.  
  1405.  
  1406.  
  1407.  
  1408.  
  1409.  
  1410.  
  1411.  
  1412.  
  1413.  
  1414.  
  1415.  
  1416.  
  1417.  
  1418.  
  1419.  
  1420.  
  1421.           There are, of course, the standard items: Restore, Move, Size,
  1422.           Minimize, Maximize, Close, (in Windows v3.0) Switch To..., and
  1423.           About Command Post....  In addition we've added:
  1424.  
  1425.           Enter License Info
  1426.           Use this selection to enter your license number and ID when you
  1427.           register your copy of Command Post.  Registering brings you
  1428.           wonderful benefits:
  1429.  
  1430.           - Gets rid of that pesky reminder window that comes up every few
  1431.            menu selections.
  1432.           - Entitles you to one hour free telephone support for 90 days.
  1433.           - Gets you the latest version of Command Post.
  1434.           - Gets you your own copy of this manual.
  1435.           - Encourages the authors of this program to continue bringing you
  1436.            new and better products instead of breaking down and getting a
  1437.            real job.
  1438.  
  1439.           Reload Menu
  1440.           This is the selection you must choose after making changes to an
  1441.           active menu file in order to enable the changes.
  1442.  
  1443.  
  1444.                                                                             21
  1445.  
  1446.                                                                TEN-MINUTE TOUR
  1447.  
  1448.           Exit Windows
  1449.           This is the same as selecting Exit Windows from the File menu.
  1450.  
  1451.           (the second column)
  1452.           The right-hand column of entries contains the names of all the open
  1453.           application windows.  You can switch to one of these programs by
  1454.           doubleclicking on its title in the menu.
  1455.  
  1456.  
  1457.  
  1458.  
  1459.  
  1460.  
  1461.  
  1462.  
  1463.  
  1464.  
  1465.  
  1466.  
  1467.  
  1468.  
  1469.  
  1470.  
  1471.  
  1472.  
  1473.  
  1474.  
  1475.  
  1476.  
  1477.  
  1478.  
  1479.  
  1480.  
  1481.  
  1482.  
  1483.  
  1484.  
  1485.  
  1486.  
  1487.  
  1488.  
  1489.  
  1490.  
  1491.  
  1492.  
  1493.  
  1494.  
  1495.  
  1496.  
  1497.  
  1498.  
  1499.  
  1500.                                                                             22
  1501.  
  1502.                                                                TEN-MINUTE TOUR
  1503.  
  1504.  
  1505.  
  1506.           The Command Post Clock
  1507.           When Command Post starts up you will see a small window in the
  1508.           lower right-hand corner of the screen with the Command Post version
  1509.           number.  This window can also act as a digital clock which shows
  1510.           the date, and the time as HH:MM or HH:MM:SS.  You can also use the
  1511.           clock to jump back to Command Post if its window is hiding behind
  1512.           something else.
  1513.            Action        Mouse         Keyboard
  1514.  
  1515.                     Click with the  Select
  1516.           Change    right mouse     "CmdPost
  1517.           display   button.         Clock" from
  1518.                                     the Command
  1519.                                     Post system
  1520.                                     menu's right-
  1521.                                     hand column.
  1522.                                     Type a space.
  1523.                                     Clock's dis-
  1524.                                     play will
  1525.                                     toggle from
  1526.                                     none to
  1527.                                     HH:MM:SS to
  1528.                                     HH:MM.
  1529.  
  1530.                     Select and      Select
  1531.           Close     drag slightly.  "CmdPost
  1532.                     When it is      Clock" from
  1533.                     inverted, type  the Command
  1534.                     ALT-F4.         Post system
  1535.                                     menu's right-
  1536.                                     hand column.
  1537.                                     Type ALT-F4.
  1538.  
  1539.                     Drag with left       (not
  1540.           Move      mouse button.     available)
  1541.                     Doubleclick          (not
  1542.           Show      with the right    available)
  1543.           system    mouse button.
  1544.           info
  1545.                     Doubleclick          (not
  1546.           Jump to   with the left     available)
  1547.           Command   button.
  1548.           Post
  1549.  
  1550.  
  1551.           If the Command Post Clock is set to display the time as HH:MM:SS,
  1552.           it will always be visible regardless of any other window at the
  1553.           same location.
  1554.  
  1555.  
  1556.                                                                             23
  1557.  
  1558.                                                                 YOUR OWN MENUS
  1559.  
  1560.  
  1561.                                      YOUR OWN MENUS
  1562.  
  1563.           The default Command Post menus provide good, basic file-management
  1564.           functions.  But the real power in Command Post comes when you add
  1565.           menu items suited to your own needs and preferences.
  1566.  
  1567.           Custom menus are your chance to put Command Post to work in just
  1568.           the way you want.  They allow you to change directories and launch
  1569.           applications with just the parameters you need - all from a simple
  1570.           menu choice. You can offer options to the user and save yourself
  1571.           (and others) the task of memorizing your disk layout. There are
  1572.           many possibilities, but we'll start with the simplest and probably
  1573.           most useful task, starting programs, after examining the menu file.
  1574.  
  1575.  
  1576.           What is a Menu File?
  1577.           Menus are defined in ASCII text files (the kind created by Notepad)
  1578.           with the extension .CPM.
  1579.  
  1580.           If you don't specify a .CPM filename when you run Command Post, it
  1581.           uses the default menu file CMDPOST.CPM.  You can also bring up
  1582.           another copy of Command Post using a different menu file by double-
  1583.           clicking on any .CPM filename from within Command Post.
  1584.           Every menu file contains menu names which show up on the Command
  1585.           Post menu bar, and menu items in the dropdown menus. For each menu
  1586.           item you'll have one or more lines of commands which Command Post
  1587.           will execute when you choose that item. Your menu will "feel" just
  1588.           like a regular Windows menu, but it will manage things in a way
  1589.           tailored to suit your needs.
  1590.  
  1591.  
  1592.  
  1593.           How to Create a Simple Menu
  1594.           Let's assume you want to keep the default menus Command Post gives
  1595.           you and add your own onto the end of the menu bar.
  1596.           CMDPOST.CPM contains the definitions for the File, Dir, View, and
  1597.           Main menus.  It calls another menu file, CMDUSER.CPM, for the
  1598.           custom menus.  CMDPOST.CPM contains some very complex programming
  1599.           and is worth taking a look at sometime.  For now however let's just
  1600.           stick to modifying CMDUSER.CPM.
  1601.  
  1602.           Using Windows Notepad, open the CMDUSER.CPM file.  You can do this
  1603.           by selecting Edit CPM Files from the Main menu.  Scroll down to the
  1604.           end of the file.  We're going to add a new menu specifically for
  1605.           desktop publishing applications.
  1606.           First off, let's name our new menu. Starting in the first column
  1607.           (at the far left), type:
  1608.  
  1609.           &DTP Apps
  1610.  
  1611.  
  1612.                                                                             25
  1613.  
  1614.                                                                 YOUR OWN MENUS
  1615.  
  1616.           Because it begins in column 1, this entry defines a menu name.  The
  1617.           "&" is optional--it defines an Alt-key combination for the entry;
  1618.           Alt-D in this example.  It will appear on the Command Post menu bar
  1619.           as "DTP Apps"..
  1620.           Since we intend to use PageMaker for our projects, we'll define a
  1621.           menu item which lets us launch it. On the next line, beginning in
  1622.           the second column (one space in), type:
  1623.  
  1624.            &PageMaker 4.0
  1625.  
  1626.           Since it begins in column 2, Command Post knows it defines a
  1627.           dropdown menu item. Below this menu item we will enter the commands
  1628.           which let you launch PageMaker.  These begin in column 5 or more
  1629.           (or you can tab once).  There are almost a hundred functions and
  1630.           commands in the Command Post Menu Language(CPML), but it takes only
  1631.           a few to get started.
  1632.  
  1633.           Well, what did we do to start PageMaker before we had Command Post?
  1634.           We had to make sure we're in the proper drive, find the PageMaker
  1635.           executable file, and doubleclick or run it.  We can put those steps
  1636.           in our PageMaker menu with the DirChange and Run functions:
  1637.           &DTP Apps
  1638.            &PageMaker 4.0
  1639.               DirChange("d:\pm\docs")
  1640.               Run("pm.exe","")
  1641.  
  1642.  
  1643.           DirChange("d:\pm\docs") tells Command Post to change to the D:
  1644.           drive and find the \PM\DOCS subdirectory. Run("pm.exe", "") tells
  1645.           Command Post to launch the PM.EXE application, with no parameters
  1646.           passed to it.
  1647.           Our simple menu is complete.  Now save the file and exit Notepad.
  1648.           Then choose Reload Menu from Command Post's system menu box so our
  1649.           new menu will take effect.
  1650.  
  1651.  
  1652.  
  1653.           Enhancing Our Menu
  1654.           Let's imagine that we have a special publishing project ("The
  1655.           Waldorf Salad Cookbook" - should sell millions) that we've been
  1656.           working on over a series of months. It has its own subdirectory,
  1657.           D:\PM\WALDORF, and several PageMaker files - CHPTR1.PM4,
  1658.           CHPTR2.PM4, etc.  We would like to have a separate menu item for
  1659.           each chapter so we can start PageMaker with the chapter already
  1660.           loaded. We always use PageMaker at full-screen, so we'd rather not
  1661.           have to press the Maximize box whenever the program starts.  Also,
  1662.           we would like to launch the CLIPBRD.EXE utility as an icon, since
  1663.           we check the clipboard often.  Let's create the first menu item ,
  1664.           which will follow the generic PageMaker 4.0 item we created above.
  1665.           Since this is a submenu item, it starts in column 2:
  1666.  
  1667.  
  1668.                                                                             26
  1669.  
  1670.                                                                 YOUR OWN MENUS
  1671.  
  1672.            PM-&Waldorf
  1673.               DirChange ("d:\pm\waldorf")
  1674.               RunZoom ("pm.exe", "chptr1.pm4")
  1675.               RunIcon ("clipbrd.exe","")
  1676.  
  1677.           Our menu item now does a lot of  work for us.  The RunZoom command
  1678.           has a new parameter, "chptr1.pm4", which tells PageMaker which file
  1679.           to load when it starts up.  The command RunIcon launches the
  1680.           Clipboard viewer as an icon.
  1681.  
  1682.           We could define more menu items for the other chapters, and find
  1683.           ourselves getting to work faster and easier than before.  Not to
  1684.           mention helping other people work on the project without getting
  1685.           lost in our particular directory structure.
  1686.  
  1687.  
  1688.           An Enhancement for Safety
  1689.           After spending 45 hours on CHPTR1.PM4, we start to worry a bit
  1690.           about losing our work.  We decide to make a diskette backup of our
  1691.           chapter at the beginning of each session.  We'll make it a part of
  1692.           the menu!  It now looks like this:
  1693.  
  1694.            PM-Waldorf Ch &1
  1695.               DirChange ("d:\pm\waldorf")
  1696.               ;Backup the current file first...
  1697.               Pause ("Backup Chapter 1","Put Backup disk in Drive A:")
  1698.               FileCopy ("Chptr1.pm4","a:chptr1.pm4",@FALSE)
  1699.               RunZoom ("pm.exe", "chptr1.pm4")
  1700.               RunIcon ("clipbrd.exe","")
  1701.  
  1702.           Our menu changes to the proper directory, and now displays a dialog
  1703.           box with the title "Backup Chapter 1", prompting the user to "Put
  1704.           Backup disk in Drive A:".  The Pause function also creates OK and
  1705.           Cancel buttons which let the user get out of the menu item (where
  1706.           did I put that disk???) or continue.  If OK is clicked, FileCopy
  1707.           copies the source file CHPTR1.PM4 to the destination A:CHPTR1.PM4.
  1708.           The @FALSE is a CPML constant which specifies that we do not want
  1709.           to prompt the user if the file already exists in the target
  1710.           directory.
  1711.  
  1712.           It's a good idea to put comments in the file when you're trying to
  1713.           accomplish something complex.  Comments start with a semicolon; the
  1714.           rest of the line is ignored.
  1715.           This menu item is getting a bit complicated, but look at what we've
  1716.           accomplished. You've automated the backup process, and made it hard
  1717.           to forget. You don't have to memorize all those manual steps, and
  1718.           you don't have to teach them to others. Menus make your life
  1719.           easier, and in this case let you sleep easier too!
  1720.  
  1721.  
  1722.  
  1723.  
  1724.                                                                             27
  1725.  
  1726.                                                                 YOUR OWN MENUS
  1727.  
  1728.           The Major Functions
  1729.           There are almost a hundred functions and commands that make up
  1730.           CPML.  But you can create powerful custom menus right away with
  1731.           these eleven:
  1732.  
  1733.  
  1734.           Running a Program
  1735.           You can launch applications in a number of ways:
  1736.  
  1737.           RunIcon (program-name, parameters)
  1738.           Starts a program as an icon at the bottom of the screen.  (See pg.
  1739.           107)
  1740.  
  1741.           Example:
  1742.           &Utilities
  1743.            &Clock
  1744.              RunIcon ("Clock", "")
  1745.  
  1746.  
  1747.           Run (program-name, parameters)
  1748.           Starts a program in a "normal" window.  Windows decides where to
  1749.           place the application's  window on the screen.  (See pg. 105)
  1750.           Example:
  1751.           &Word Processing
  1752.            Edit &MyFile
  1753.              Run ("Notepad", "myfile.txt")
  1754.  
  1755.  
  1756.           RunZoom (program-name, parameters)
  1757.           Starts a program as a full-screen window.  (See pg. 108)
  1758.  
  1759.           Example:
  1760.           &Accounting
  1761.            The &BIG spreadsheet
  1762.              RunZoom ("Excel", "bigsheet.xls")
  1763.  
  1764.  
  1765.  
  1766.  
  1767.  
  1768.  
  1769.  
  1770.  
  1771.  
  1772.  
  1773.  
  1774.  
  1775.  
  1776.  
  1777.  
  1778.  
  1779.  
  1780.                                                                             28
  1781.  
  1782.                                                                 YOUR OWN MENUS
  1783.  
  1784.  
  1785.  
  1786.           Getting Information from the User
  1787.           Often you need to have the user enter extra information before you
  1788.           can process a menu request.  Here are the simplest ways to do that:
  1789.  
  1790.           AskYesNo (title, question)
  1791.           Displays a dialog box with a given title, posing a question to the
  1792.           user, who may click a Yes, No, or Cancel button.  (See pg. 50)
  1793.  
  1794.           Example:
  1795.           &Utilities
  1796.            Delete MyFile...
  1797.              Cont = AskYesNo ("My Menu", "You REALLY want to do this?")
  1798.              Terminate (Cont==@NO, "", "")
  1799.              FileDelete ("MyFile.txt")
  1800.  
  1801.  
  1802.           AskLine (title, prompt, default)
  1803.           Displays a dialog box with a given title, which prompts the user
  1804.           for a line of input.  Returns the default if the user just presses
  1805.           the OK button.  (See pg. 48)
  1806.           Example:
  1807.           &Word Processing
  1808.            &Edit a file...
  1809.              TheFile = AskLine ("Edit File", "Filename:", CurrentFile())
  1810.              Run ("Notepad", TheFile)
  1811.  
  1812.  
  1813.           ItemSelect (title, list, delimiter)
  1814.           Displays a listbox filled with items from a list you specify in a
  1815.           string.  The items are separated in your string by a delimiter
  1816.           character.  Very useful in conjunction with FileItemize,
  1817.           DirItemize, and WinItemize.  (See pg. 91)
  1818.  
  1819.           Example:
  1820.           &DTP Apps
  1821.            PM-&Waldorf Project
  1822.              DirChange ("d:\pm\waldorf")
  1823.              WFiles = FileItemize ("chptr*.pm4")
  1824.              TheFile = ItemSelect ("Select A Chapter", WFiles, " ")
  1825.              RunZoom ("pm.exe", TheFile)
  1826.  
  1827.  
  1828.  
  1829.  
  1830.  
  1831.  
  1832.  
  1833.  
  1834.  
  1835.  
  1836.                                                                             29
  1837.  
  1838.                                                                 YOUR OWN MENUS
  1839.  
  1840.  
  1841.  
  1842.           Displaying Information
  1843.           It's easy to display information to the user:
  1844.  
  1845.           Message (title, text)
  1846.           This command displays a message box with a title and text you
  1847.           specify, until the user presses the OK button.  (See pg. 97)
  1848.  
  1849.           Example:
  1850.           &Miscellany
  1851.            Show &Date && Time
  1852.              DT = DateTime ()
  1853.              Message ("Current Date & Time", "It is now %DT%")
  1854.  
  1855.  
  1856.           Pause (title, text)
  1857.           This command is similar to Message except an exclamation-point icon
  1858.           appears in the message box, and the user can press OK or Cancel.
  1859.           If they press Cancel, the menu item exits.  (See pg. 103)
  1860.           Example:
  1861.           &Daily Utilities
  1862.            &Delete .BAK files
  1863.              Pause ("Delete Backups", "Last chance to stop!")
  1864.              ;if it gets this far, they pressed OK...
  1865.              FileDelete ("*.bak")
  1866.  
  1867.  
  1868.           Terminate (expression, title, message)
  1869.           This command stops processing the menu item if the expression is
  1870.           true.  If either the title or the message are not null strings
  1871.           (""), then a message box is displayed to alert the user to what has
  1872.           happened.  (See pg. 122)
  1873.  
  1874.           Example:
  1875.           &Restricted Operations
  1876.            &Payroll History
  1877.              UsersPW = AskLine ("*RESTRICTED*","Enter your password:","")
  1878.              ;assuming executive's password already saved in WIN.INI:
  1879.              RealPW = IniRead ("MyCompany", "Executive PW", "")
  1880.              Terminate (UsersPW!=RealPW, "ERROR", "Wrong Password!")
  1881.  
  1882.              ;if they got this far, they gave correct password:
  1883.              RunZoom ("Excel.exe", "Personel.xls")
  1884.  
  1885.  
  1886.  
  1887.  
  1888.  
  1889.  
  1890.  
  1891.  
  1892.                                                                             30
  1893.  
  1894.                                                                 YOUR OWN MENUS
  1895.  
  1896.  
  1897.  
  1898.           Other Useful Functions
  1899.  
  1900.           CurrentFile ( )
  1901.           Returns the name of the selected file (the one with the dotted
  1902.           rectangle around it) from the Command Post window.  (See pg. 57)
  1903.           Example:
  1904.           &Editing
  1905.            Run &Notepad with selected file
  1906.              Run ("Notepad", CurrentFile())
  1907.  
  1908.  
  1909.           DirChange (pathname)
  1910.           Changes the directory to the pathname specified.  (See pg. 62)
  1911.  
  1912.           Example:
  1913.           &Miscellany
  1914.            &Run some program not in path
  1915.              DirChange ("c:\some\dir\not\in\path")
  1916.              Run ("Obscure.exe","")
  1917.  
  1918.  
  1919.  
  1920.  
  1921.  
  1922.  
  1923.  
  1924.  
  1925.  
  1926.  
  1927.  
  1928.  
  1929.  
  1930.  
  1931.  
  1932.  
  1933.  
  1934.  
  1935.  
  1936.  
  1937.  
  1938.  
  1939.  
  1940.  
  1941.  
  1942.  
  1943.  
  1944.  
  1945.  
  1946.  
  1947.  
  1948.                                                                             31
  1949.  
  1950.                                                     COMMAND POST MENU LANGUAGE
  1951.  
  1952.  
  1953.                                COMMAND POST MENU LANGUAGE
  1954.  
  1955.  
  1956.  
  1957.           Menu Structure
  1958.           Menus are defined in a menu file.  Each menu file consists of one
  1959.           or more lines of menu statements.  Each line is terminated with a
  1960.           carriage return / line feed (CRLF) combination and can be up to 256
  1961.           characters long.
  1962.  
  1963.           There are two main parts of a menu file:
  1964.           The first section, which is optional, is the initialization code.
  1965.           This section is executed once when the menu is first loaded and
  1966.           run.  It's located before the first menu item declaration.
  1967.  
  1968.           The remainder of the menu file consists of menu item titles and
  1969.           their associated statements.  The code under each menu title is
  1970.           executed when the corresponding menu item is selected.  Execution
  1971.           begins at the first statement under a menu item and continues up to
  1972.           the definition of the next item.
  1973.  
  1974.  
  1975.           Menu Items
  1976.           Menu titles can consist of letters, digits, spaces, punctuation
  1977.           marks; in fact any displayable ANSI characters your text editor can
  1978.           create.
  1979.  
  1980.           There are special characters you can use to modify the appearance
  1981.           of items in the menus.
  1982.           &  Causes the following character to be underlined in the menu item.
  1983.           The user can select the item by pressing the ALT key with the
  1984.           character instead of using the mouse.
  1985.  
  1986.           |  In a main menu, puts this item on a new line.
  1987.           |  In a dropdown menu, this item starts a new column.
  1988.           _  Used to create a horizontal bar (in dropdown menus only).
  1989.           Most CPML commands carry out functions based on your menu
  1990.           selections.  However there are a few functions (summarized on pg.
  1991.           42) that can alter the characteristics of the menu titles
  1992.           themselves.  For instance you can put a checkmark next to a menu,
  1993.           or disable and gray it.
  1994.  
  1995.           In order to identify a menu item within a CPML statement, each menu
  1996.           item you define has an associated menu name.  The menu name is
  1997.           built using only the letters and digits that make up the menu
  1998.           title.  Menu names are case-insensitive; you don't have to worry
  1999.           about how the actual menu title is capitalized in order to identify
  2000.           it.
  2001.  
  2002.  
  2003.  
  2004.                                                                             33
  2005.  
  2006.                                                     COMMAND POST MENU LANGUAGE
  2007.  
  2008.           For menu items in a popup menu, the menu name consists of its
  2009.           parent menu's name, plus the popup menu item's name concatenated at
  2010.           the end.
  2011.           These menu names are valid as soon as the menu file is loaded, so
  2012.           you can use the menu management functions in the initialization
  2013.           code before the menus even appear.
  2014.  
  2015.           Example:
  2016.              PW=AskLine ("","Enter your password:", "")
  2017.              ;assuming the resident guru's pw is already in WIN.INI:
  2018.              RealPW = IniRead ("Our Company", "Tech Guru PW", "")
  2019.              Terminate (PW==RealPW, "Access", "You have FULL access")
  2020.  
  2021.              MenuChange("SystemUtilitiesCleanupDir",  @DISABLE)
  2022.              MenuChange("SystemUtilitiesEditBatFiles",@DISABLE)
  2023.              MenuChange("SystemUtilitiesEditWinIni",  @DISABLE)
  2024.              Message ("Access", "You have LIMITED access")
  2025.  
  2026.           &System Utilities  ;name = "SystemUtilities"
  2027.            &Cleanup Dir      ;name = "SystemUtilitiesCleanupDir"
  2028.              ...
  2029.            &Edit BAT Files...;name = "SystemUtilitiesEditBatFiles"
  2030.              ...
  2031.            &Edit WIN.INI     ;name = "SystemUtilitiesEditWinIni"
  2032.              ...
  2033.  
  2034.  
  2035.           Language Components
  2036.           The statements you write to execute the menu items are constructed
  2037.           from constants, variables, operators, functions, commands, and
  2038.           comments.
  2039.  
  2040.  
  2041.           Constants
  2042.           The programming language supports both integer and string
  2043.           constants.
  2044.  
  2045.  
  2046.           Integer Constants
  2047.           Integer constants are built from the digits 0 through 9.  They can
  2048.           range in magnitude from negative to positive 231 -1  (approximately
  2049.           two billion).  Constants larger than these permissible magnitudes
  2050.           will produce unpredictable results.
  2051.           Examples of integer constants:
  2052.                       1
  2053.                     -45
  2054.                  377849
  2055.             -1999999999
  2056.  
  2057.  
  2058.  
  2059.  
  2060.                                                                             34
  2061.  
  2062.                                                     COMMAND POST MENU LANGUAGE
  2063.  
  2064.           String Constants
  2065.           String constants are comprised of displayable characters bounded by
  2066.           quote marks.  You can use double quotes ("), single quotes ('), or
  2067.           back quotes (`) to enclose a string constant, as long as the same
  2068.           type of quote is used to both start and end it.  If you need to
  2069.           imbed the delimiting quote mark inside the string constant, use the
  2070.           delimiting quote mark twice.
  2071.           Examples of string constants:
  2072.              "a"
  2073.              `Betty Boop`
  2074.              "This constant has an imbedded "" mark"
  2075.              'This constant also has an imbedded " mark'
  2076.  
  2077.           Predefined Constants
  2078.           The programming language has a number of built-in integer constants
  2079.           that can be used for various purposes.  These start with the @-
  2080.           sign, and are case-insensitive (although we prefer to use ALL
  2081.           CAPS).
  2082.  
  2083.           Some predefined constants:
  2084.              @FALSE                             @TILE
  2085.              @NO                                @TRUE
  2086.              @STACK                             @YES
  2087.  
  2088.           A list of all the predefined constants can be found in Appendix D:
  2089.           Predefined Constants.
  2090.  
  2091.  
  2092.  
  2093.           Identifiers
  2094.           Identifiers are the names supplied for variables, functions, and
  2095.           commands in your program.
  2096.           An identifier is a sequence of one or more letters or digits that
  2097.           begins with a letter.  Identifiers may have up to 30 characters.
  2098.  
  2099.           All identifiers are case insensitive.  Upper- and lowercase charac-
  2100.           ters may be mixed at will inside variable names, commands or
  2101.           functions.
  2102.           For example these statements all mean the same thing:
  2103.              AskLine (MyTitle, Prompt, Default)
  2104.              ASKLINE (MYTITLE, PROMPT, DEFAULT)
  2105.              aSkLiNe (MyTiTlE, pRoMpT, dEfAuLt)
  2106.  
  2107.  
  2108.           Variables
  2109.           A variable may contain an integer, a string, or a string
  2110.           representing an integer.  Automatic conversions between integers
  2111.           and strings are performed as a matter of course during execution.
  2112.  
  2113.  
  2114.  
  2115.  
  2116.                                                                             35
  2117.  
  2118.                                                     COMMAND POST MENU LANGUAGE
  2119.  
  2120.           If a function requires a string argument and an integer argument is
  2121.           supplied, the variable will be automatically modified to include
  2122.           the representative string.
  2123.           If a function requires an integer argument and a string argument is
  2124.           supplied, an attempt will be made to convert the string to an inte-
  2125.           ger.  If it does not convert successfully, an error will result.
  2126.  
  2127.  
  2128.  
  2129.           Keywords Are Reserved
  2130.           "Keywords" are the predefined identifiers that have special meaning
  2131.           to the programming language.  These cannot be used as variable
  2132.           names.
  2133.           CPML keywords consist of the functions, commands, and predefined
  2134.           constants.
  2135.  
  2136.           Some examples of reserved keywords:
  2137.              beep
  2138.              dirchange
  2139.              @Yes
  2140.              filecopy
  2141.  
  2142.  
  2143.           Operators
  2144.           The programming language operators take one operand ("unary
  2145.           operators") or two operands ("binary operators").
  2146.           Unary operators (integers only):
  2147.              -    Arithmetic Negation (Two's complement)
  2148.              +    Identity (Unary plus)
  2149.              ~    Bitwise Not.  Changes each 0 bit to 1, and vice-versa.
  2150.              !    Logical Not.  Produces 0 (@FALSE) if the operand is
  2151.                   nonzero, else 1 (@TRUE) if the operand is zero.
  2152.  
  2153.  
  2154.           Binary arithmetic operators (integers only):
  2155.              *    Multiplication
  2156.              /    Division
  2157.              mod  Modulo
  2158.              +    Addition
  2159.              -    Subtraction
  2160.              <<   Left Shift
  2161.              >>   Right Shift
  2162.              &    Bitwise And
  2163.              |    Bitwise Or
  2164.              ^    Bitwise Exclusive Or  (XOR)
  2165.              &&   Logical And
  2166.              | |  Logical Or
  2167.  
  2168.           Binary relational operators (integers and strings):
  2169.              >      Greater-than
  2170.              >=     Greater-than or equal
  2171.  
  2172.                                                                             36
  2173.  
  2174.                                                     COMMAND POST MENU LANGUAGE
  2175.  
  2176.              <      Less-than
  2177.              <=     Less-than or equal
  2178.              ==     Equality
  2179.              != or <>Inequality
  2180.           Assignment operator (integers and strings):
  2181.              =      Assigns evaluated result of an expression to a variable
  2182.  
  2183.  
  2184.  
  2185.           Precedence and evaluation order
  2186.           The precedence of the operators affect the evaluation of operands
  2187.           in expressions.  Operands associated with higher-precedence
  2188.           operators are evaluated before the lower-precedence operators.
  2189.           The table below shows the precedence of the operators.  Where
  2190.           operators have the same precedence, they are evaluated from left to
  2191.           right.
  2192.  
  2193.           Operator            Description
  2194.              ( )              Parenthetical grouping
  2195.              ~ ! - +          Unary operators
  2196.              * / mod          Multiplication & Division
  2197.              + -              Addition & Subtraction
  2198.              <<  >>           Shift operators
  2199.              < <= == >= > != <>   Relational operators
  2200.              & ^ |            Bit manipulation operators
  2201.              && | |           Logical operators
  2202.  
  2203.  
  2204.           Comments
  2205.           A comment is a sequence of characters that are ignored when
  2206.           processing a menu item.  A semicolon (not otherwise part of a
  2207.           string constant) indicates the beginning of a comment.
  2208.           All characters to the right of the semicolon are considered
  2209.           comments and are ignored.
  2210.  
  2211.           Blank lines are also ignored.
  2212.           Examples of comments:
  2213.              ;This is a comment
  2214.              abc=5  ;This is also a comment
  2215.  
  2216.  
  2217.           Statements
  2218.           The statements of a menu specify what to do when the menu item is
  2219.           selected.
  2220.  
  2221.  
  2222.           Assignment Statements
  2223.           Assignment statements are used to set variables to specific or
  2224.           computed values.  Variables may be set to integers or strings.
  2225.  
  2226.  
  2227.  
  2228.                                                                             37
  2229.  
  2230.                                                     COMMAND POST MENU LANGUAGE
  2231.  
  2232.           Examples:
  2233.              a=5
  2234.              value=Average(a,10,15)
  2235.              location="Northern Hemisphere"
  2236.              World = strcat(location," ","Southern Hemisphere")
  2237.  
  2238.           Control Statements
  2239.           Control statements are generally used to execute system management
  2240.           functions and consist of a call to a command without assigning any
  2241.           return values.
  2242.           Examples:
  2243.              run("clock.exe","")
  2244.              delay(5)
  2245.              winclose("Clock")
  2246.              Exit
  2247.  
  2248.  
  2249.           Substitution
  2250.           The menu language has a powerful substitution feature which inserts
  2251.           the contents of a string variable into a statement before the line
  2252.           is parsed.
  2253.  
  2254.           To substitute the contents of a variable in the statement, simply
  2255.           put a percent-sign (%) on both sides of the variable name.
  2256.           Examples:
  2257.              MyCmd="DirChange('C:\')"   ;set MyCmd to a command
  2258.              %MyCmd%               ;execute the command
  2259.  
  2260.           ...or consider this one:
  2261.  
  2262.              IniWrite ("PC", "Owner", "Jenny")
  2263.              ...
  2264.              Owner = IniRead ("PC", "Owner", "somebody")
  2265.              message ("", "This is %Owner%'s PC")
  2266.  
  2267.           will produce this message box:
  2268.  
  2269.  
  2270.  
  2271.  
  2272.  
  2273.  
  2274.  
  2275.           To put a single percent-sign (%) on a source line, specify a double
  2276.           percent sign(%%).  This is required even inside quoted strings.
  2277.  
  2278.  
  2279.  
  2280.  
  2281.  
  2282.  
  2283.  
  2284.                                                                             38
  2285.  
  2286.                                                     COMMAND POST MENU LANGUAGE
  2287.  
  2288.  
  2289.           Language Directives
  2290.           A "language directive" is a command to the CPML interpreter, as
  2291.           opposed to a menu statement.  These begin with a pound-sign ("#")
  2292.           in column 1.
  2293.           Currently there is only one directive recognized by Command Post:
  2294.           #NextFile. This directive tells the CPML interpreter to append
  2295.           another .CPM file to the current one before building the menus.
  2296.           You can append only one extra menu file in this way.
  2297.  
  2298.  
  2299.  
  2300.           Function Parameters
  2301.           Most of the functions and commands in the language require
  2302.           parameters.  These come in three types:
  2303.              Integer
  2304.              String
  2305.              Variable name
  2306.  
  2307.           CPML performs automatic conversions between strings and integers,
  2308.           so in general you can use them interchangeably.
  2309.  
  2310.           Integer parameters may be any of the following:
  2311.              An integer (i.e. 23)
  2312.              A string representing an integer (i.e. "23")
  2313.              A variable containing an integer
  2314.              A variable containing a string representing an integer
  2315.  
  2316.           String parameters may be any of the following:
  2317.              A string
  2318.              An integer
  2319.              A variable containing a string
  2320.              A variable containing an integer
  2321.  
  2322.  
  2323.  
  2324.           Error Handling
  2325.           There are three types of errors that can occur while processing a
  2326.           menu item:  Minor, Moderate, and Fatal.  What happens when an error
  2327.           occurs depends on the current error mode, which is set with the
  2328.           ErrorMode function.
  2329.           There are three possible modes you can specify:
  2330.  
  2331.           @CANCEL
  2332.              User is notified when any error occurs, and then the menu item is
  2333.              cancelled.  This is the default.
  2334.           @NOTIFY
  2335.              User is notified when any error occurs, and has option to
  2336.              continue unless the error is fatal.
  2337.  
  2338.  
  2339.  
  2340.                                                                             39
  2341.  
  2342.                                                     COMMAND POST MENU LANGUAGE
  2343.  
  2344.           @OFF
  2345.              User is only notified if the error is moderate or fatal.  User
  2346.              has option to continue unless the error is fatal.
  2347.           The function LastError returns the code of the most-recent error
  2348.           encountered during the current menu item.
  2349.  
  2350.           Minor errors are numbered from 1000 to 1999.
  2351.           Moderate errors are numbered from 2000 to 2999.
  2352.           Fatal errors are numbered from 3000 to 3999.
  2353.           Error handling is reset to @CANCEL at the start of each menu item.
  2354.  
  2355.  
  2356.  
  2357.           The Functions & Statements
  2358.  
  2359.  
  2360.           Inputting Information
  2361.           AskLine (title, prompt, default)
  2362.              Lets user enter a line of information.
  2363.           AskYesNo (title, question)
  2364.              Lets user choose from Yes, No, or Cancel.
  2365.  
  2366.           ItemSelect (title, list, delimiter)
  2367.              Chooses an item from a listbox.
  2368.           TextBox (title, filename)
  2369.              Fills a listbox from text strings in a file.
  2370.  
  2371.  
  2372.  
  2373.           Displaying Information
  2374.           Beep
  2375.              Beeps at the user.
  2376.           Display (seconds, title, text)
  2377.              Momentarily displays a string.
  2378.  
  2379.           Message (title, text)
  2380.              Displays text in a message box.
  2381.           Pause (title, text)
  2382.              Displays text in a message box.
  2383.  
  2384.           Terminate (expression, title, message)
  2385.              Conditionally ends a menu operation, with a notice if desired.
  2386.  
  2387.  
  2388.           File Management
  2389.           CurrentFile ( )
  2390.              Returns the selected file or subdirectory name.
  2391.  
  2392.           FileCopy (from-list, to-file, warning)
  2393.              Copies files.
  2394.  
  2395.  
  2396.                                                                             40
  2397.  
  2398.                                                     COMMAND POST MENU LANGUAGE
  2399.  
  2400.           FileDelete (file-list)
  2401.              Deletes files.
  2402.           FileExist (filename)
  2403.              Determines if a file exists.
  2404.  
  2405.           FileItemize (file-list)
  2406.              Builds a list of files.
  2407.           FileLocate (filename)
  2408.              Finds a file within the current DOS path.
  2409.  
  2410.           FileMove (from-list, to-file, warning)
  2411.              Moves files to another set of pathnames.
  2412.           FileRename (from-list, to-file)
  2413.              Renames files to another set of names.
  2414.  
  2415.           FileSize (file-list)
  2416.              Adds up the total size of a set of files.
  2417.  
  2418.  
  2419.           Directory Management
  2420.           DirChange ([d:]path)
  2421.              Changes the current directory.
  2422.  
  2423.           DirGet ( )
  2424.              Returns the current directory path.
  2425.           DirHome ( )
  2426.              Returns the initial directory path.
  2427.  
  2428.           DirItemize (dir-list)
  2429.              Builds a list of directories.
  2430.           DirMake ([d:]path)
  2431.              Creates a new directory.
  2432.  
  2433.           DirRemove ([d:]path)
  2434.              Removes an existing directory.
  2435.  
  2436.  
  2437.           Disk Drive Management
  2438.           DiskFree (drive-list)
  2439.              Returns the amount of free space on a set of drives.
  2440.  
  2441.           LogDisk (drive)
  2442.              Changes the logged disk drive.
  2443.  
  2444.  
  2445.           Window Management
  2446.           WinActivate (partial-windowname)
  2447.              Makes an application window the active window.
  2448.  
  2449.           WinArrange (style)
  2450.              Arranges all running application windows on the screen.
  2451.  
  2452.                                                                             41
  2453.  
  2454.                                                     COMMAND POST MENU LANGUAGE
  2455.  
  2456.           WinClose (partial-windowname)
  2457.              Closes an application window.
  2458.           WinCloseNot (partial-windowname [, partial-windowname]...)
  2459.              Closes all application windows except those specified.
  2460.  
  2461.           WinGetActive ( )
  2462.              Gets the title of the active window.
  2463.           WinHide (partial-windowname)
  2464.              Hides an application window.
  2465.  
  2466.           WinIconize (partial-windowname)
  2467.              Turns an application window into an icon.
  2468.           WinItemize ( )
  2469.              Lists all the main windows currently running.
  2470.  
  2471.           WinPlace (x-ul, y-ul, x-br, y-br, partial-windowname)
  2472.              Changes the size and position of an application window on the
  2473.              screen.
  2474.           WinShow (partial-windowname)
  2475.              Shows a currently-hidden application window.
  2476.  
  2477.           WinTitle (partial-windowname, new-windowname)
  2478.              Changes the title of an application window.
  2479.           WinWaitClose (partial-windowname)
  2480.              Waits until an application window is closed.
  2481.  
  2482.           WinZoom (partial-windowname)
  2483.              Maximizes an application window to full-screen.
  2484.  
  2485.  
  2486.           Menu Management
  2487.           IsMenuChecked (menuitem-name)
  2488.              Determines if a menuitem is checked.
  2489.  
  2490.           IsMenuEnabled (menuitem-name)
  2491.              Determines if a menuitem is enabled.
  2492.           MenuChange (menuitem-name, flags)
  2493.              Modifies displayed characteristics of a menuitem.
  2494.  
  2495.  
  2496.  
  2497.           Program Management
  2498.           Run (program-name, parameters)
  2499.              Runs a program as a normal window.
  2500.           RunHide (program-name, parameters)
  2501.              Runs a program in a hidden window.
  2502.  
  2503.           RunIcon (program-name, parameters)
  2504.              Runs a program as an icon.
  2505.           RunZoom (program-name, parameters)
  2506.              Runs a program in a maximized window.
  2507.  
  2508.                                                                             42
  2509.  
  2510.                                                     COMMAND POST MENU LANGUAGE
  2511.  
  2512.  
  2513.           String Handling
  2514.           Char2Num (string)
  2515.              Returns the ANSI code of a string's first character.
  2516.           IsNumber (string)
  2517.              Determines if a string represents a valid number.
  2518.  
  2519.           Num2Char (number)
  2520.              Converts a number to the ANSI character it represents.
  2521.           StrCat (string[, string]...)
  2522.              Concatenates strings together.
  2523.  
  2524.           StrCmp (string1, string2)
  2525.              Compares two strings.
  2526.           StrFill (string, string-length)
  2527.              Builds a string from a repeated smaller string.
  2528.  
  2529.           StrFix (base-string, padding-string, length)
  2530.              Pads or truncates a string to a fixed length.
  2531.           StrICmp (string1, string2)
  2532.              Compares two strings, ignoring their case.
  2533.  
  2534.           StrIndex (main-str, sub-str, start, direction)
  2535.              Locates a string within a larger string.
  2536.           StrLen (string)
  2537.              Returns the length of a string
  2538.  
  2539.           StrLower (string)
  2540.              Converts a string to all lower-case characters.
  2541.           StrScan (main-str, delims, start, direction)
  2542.              Finds an occurrence of one or more delimiter characters in a
  2543.              string.
  2544.  
  2545.           StrSub (string, start, length)
  2546.              Returns a substring from within a string.
  2547.           StrTrim (string)
  2548.              Trims leading and trailing blanks from a string.
  2549.  
  2550.           StrUpper (string)
  2551.              Converts a string to all upper-case characters.
  2552.  
  2553.  
  2554.           Arithmetic Functions
  2555.           Abs (number)
  2556.              Returns the absolute value of a number.
  2557.  
  2558.           Average (num [, num]...)
  2559.              Returns the average of a list of integers.
  2560.           Max (num [, num]...)
  2561.              Determines the highest number in a list.
  2562.  
  2563.  
  2564.                                                                             43
  2565.  
  2566.                                                     COMMAND POST MENU LANGUAGE
  2567.  
  2568.           Min (num [, num]...)
  2569.              Determines the lowest number in a list.
  2570.           Random (max)
  2571.              Generates a positive random number.
  2572.  
  2573.  
  2574.  
  2575.           Clipboard Handling
  2576.           ClipAppend (string)
  2577.              Appends a string to the end of the Clipboard.
  2578.           ClipGet ( )
  2579.              Returns the Clipboard contents into a string.
  2580.  
  2581.           ClipPut (string)
  2582.              Replaces the Clipboard contents with a string.
  2583.  
  2584.  
  2585.           System Control
  2586.           DateTime ( )
  2587.              Returns the current date and time.
  2588.  
  2589.           Debug (@ON | @OFF)
  2590.              Turns Debug mode on or off.
  2591.           Delay (seconds)
  2592.              Pauses menu execution.
  2593.  
  2594.           Drop (var [, var]...)
  2595.              Deletes variables to recover their memory.
  2596.           EndSession ( )
  2597.              Ends the current Windows session.
  2598.  
  2599.           Environment (env-variable)
  2600.              Returns the value of a DOS environment variable.
  2601.           ErrorMode (mode)
  2602.              Sets what happens in the event of an error.
  2603.  
  2604.           Execute statement
  2605.              Directly executes a Command Post statement.
  2606.           Exit
  2607.              Exits the current menuitem's operation.
  2608.  
  2609.           IniRead (section, keyname, default)
  2610.              Reads a string from the win.ini file.
  2611.           IniWrite (section, keyname, string)
  2612.              Writes a string to the win.ini file.
  2613.  
  2614.           IsDefined (variable)
  2615.              Determines if a variable is currently defined.
  2616.           IsRunning ( )
  2617.              Determines if another copy of Command Post is running.
  2618.  
  2619.  
  2620.                                                                             44
  2621.  
  2622.                                                     COMMAND POST MENU LANGUAGE
  2623.  
  2624.           LastError ( )
  2625.              Returns the last error encountered.
  2626.           #NextFile  filename
  2627.              Links a second Command Post menu file onto the one invoked.
  2628.  
  2629.           OtherDir ( )
  2630.              Finds the directory of the "other" running Command Post.
  2631.           OtherUpdate ( )
  2632.              Updates other running Command Post's display.
  2633.  
  2634.           SetDisplay (detail-level, sort-by, masks)
  2635.              Changes how the Command Post File Manager lists files.
  2636.           Terminate (expression, title, message)
  2637.              Conditionally ends a menu operation, with a notice if desired.
  2638.  
  2639.           Version ( )
  2640.              Returns the version of Command Post currently running.
  2641.           WinVersion (which-level)
  2642.              Gets the version of Windows that is currently running.
  2643.  
  2644.           Yield
  2645.              Pauses menu processing so other applications can process some
  2646.              messages.
  2647.  
  2648.  
  2649.  
  2650.  
  2651.  
  2652.  
  2653.  
  2654.  
  2655.  
  2656.  
  2657.  
  2658.  
  2659.  
  2660.  
  2661.  
  2662.  
  2663.  
  2664.  
  2665.  
  2666.  
  2667.  
  2668.  
  2669.  
  2670.  
  2671.  
  2672.  
  2673.  
  2674.  
  2675.  
  2676.                                                                             45
  2677.  
  2678.                                                      CPML  FUNCTION  REFERENCE
  2679.  
  2680.  
  2681.                                           CPML
  2682.                                         FUNCTION
  2683.                                        REFERENCE
  2684.  
  2685.  
  2686.  
  2687.           Introduction
  2688.           CPML gives you almost a hundred functions and control statements,
  2689.           which we describe in detail in this section.
  2690.  
  2691.           We use a shorthand notation to indicate the syntax of the
  2692.           functions.
  2693.           Function names and other actual characters you type are in
  2694.           boldface.  Optional parameters are enclosed in square brackets "[
  2695.           ]".  When a function takes a variable number of parameters, the
  2696.           variable parts will be followed by ellipses ("...").
  2697.  
  2698.           Take for example string concatenation:
  2699.           StrCat (string[, string]...)
  2700.  
  2701.           This says that the StrCat function takes at least one string
  2702.           parameter.  Optionally you can specify more strings to concatenate.
  2703.           If you do, you must separate the strings with commas.
  2704.           For each function and control statement, we show you the Syntax,
  2705.           describe the Parameters (if any), the value it Returns (if any), a
  2706.           description of the function, any nonfatal Errors specific to the
  2707.           function, Example code (shown in courier type), and related
  2708.           functions you may want to See Also.
  2709.  
  2710.  
  2711.  
  2712.  
  2713.  
  2714.  
  2715.  
  2716.  
  2717.  
  2718.  
  2719.  
  2720.  
  2721.  
  2722.  
  2723.  
  2724.  
  2725.  
  2726.  
  2727.  
  2728.  
  2729.  
  2730.  
  2731.  
  2732.                                                                             47
  2733.  
  2734.                                                      CPML  FUNCTION  REFERENCE
  2735.  
  2736.  
  2737.  
  2738.           Abs
  2739.           Returns the magnitude of the argument.
  2740.  
  2741.           Syntax:
  2742.              Abs (integer)
  2743.  
  2744.           Parameters:
  2745.              "integer" = integer whose absolute value is desired.
  2746.  
  2747.           Returns:
  2748.              (integer) absolute value of argument.
  2749.  
  2750.  
  2751.           Example:
  2752.              DY=abs(y1-y2)
  2753.              Message("Years","There are %DY% years 'twixt %y1% and %y2%")
  2754.  
  2755.  
  2756.           See Also:
  2757.              Average, Max, Min
  2758.  
  2759.  
  2760.  
  2761.  
  2762.  
  2763.  
  2764.  
  2765.  
  2766.  
  2767.  
  2768.  
  2769.  
  2770.  
  2771.  
  2772.  
  2773.  
  2774.  
  2775.  
  2776.  
  2777.  
  2778.  
  2779.  
  2780.  
  2781.  
  2782.  
  2783.  
  2784.  
  2785.  
  2786.  
  2787.  
  2788.                                                                             48
  2789.  
  2790.                                                      CPML  FUNCTION  REFERENCE
  2791.  
  2792.  
  2793.  
  2794.           AskLine
  2795.           Prompts the user for one line of input.
  2796.  
  2797.           Syntax:
  2798.              AskLine (title, prompt, default)
  2799.  
  2800.           Parameters:
  2801.              "title" = title of the dialog box.
  2802.              "prompt" =  question to be put to the user.
  2803.              "default" = default answer.
  2804.  
  2805.           Returns:
  2806.              (string)  user response.
  2807.  
  2808.           Use this command to query the user for a line of data.  The entire
  2809.           user response will be returned if the user presses the OK button or
  2810.           the Enter key.  If they press Cancel, the menu item processing is
  2811.           cancelled.
  2812.  
  2813.  
  2814.           Example:
  2815.              Name=AskLine("Dessert","Please enter your name","")
  2816.              Dsrt=AskLine("Dessert","Favorite dessert?","Ice Cream")
  2817.              message(strcat(Name,"'s dessert is "),Dsrt)
  2818.  
  2819.           produces:
  2820.  
  2821.  
  2822.  
  2823.  
  2824.  
  2825.  
  2826.  
  2827.  
  2828.  
  2829.  
  2830.  
  2831.  
  2832.  
  2833.  
  2834.  
  2835.  
  2836.  
  2837.  
  2838.  
  2839.  
  2840.  
  2841.  
  2842.  
  2843.  
  2844.                                                                             49
  2845.  
  2846.                                                      CPML  FUNCTION  REFERENCE
  2847.  
  2848.           ...and then, if Jenny types "JELL-O" and presses OK:
  2849.  
  2850.  
  2851.  
  2852.  
  2853.  
  2854.  
  2855.  
  2856.  
  2857.  
  2858.           See Also:
  2859.              AskYesNo, Display, ItemSelect, Message, Pause, TextBox
  2860.  
  2861.  
  2862.  
  2863.  
  2864.  
  2865.  
  2866.  
  2867.  
  2868.  
  2869.  
  2870.  
  2871.  
  2872.  
  2873.  
  2874.  
  2875.  
  2876.  
  2877.  
  2878.  
  2879.  
  2880.  
  2881.  
  2882.  
  2883.  
  2884.  
  2885.  
  2886.  
  2887.  
  2888.  
  2889.  
  2890.  
  2891.  
  2892.  
  2893.  
  2894.  
  2895.  
  2896.  
  2897.  
  2898.  
  2899.  
  2900.                                                                             50
  2901.  
  2902.                                                      CPML  FUNCTION  REFERENCE
  2903.  
  2904.  
  2905.  
  2906.           AskYesNo
  2907.           Prompts the user for a YES or NO answer.
  2908.  
  2909.           Syntax:
  2910.              AskYesNo (title, question)
  2911.  
  2912.           Parameters
  2913.              "title" = title of the question box.
  2914.              "question" =question to be put to the user.
  2915.  
  2916.           Returns:
  2917.              (integer) @YES or @NO, depending on the button pressed.
  2918.  
  2919.           This command displays a message box with three pushbuttons - Yes,
  2920.           No, and Cancel.  If the user presses Cancel, the current menu item
  2921.           is ended so there is no return value.
  2922.  
  2923.  
  2924.           Example:
  2925.              q=AskYesNo('Testing','Please press "YES"')
  2926.              Terminate(q==@YES,"","")
  2927.              Display(3,'ERROR',"I said press 'YES'")
  2928.  
  2929.           produces:
  2930.  
  2931.  
  2932.  
  2933.  
  2934.  
  2935.  
  2936.  
  2937.  
  2938.           ...and if the user presses No:
  2939.  
  2940.  
  2941.  
  2942.  
  2943.  
  2944.  
  2945.           See Also:
  2946.              AskLine, Display, ItemSelect, Message, Pause, TextBox
  2947.  
  2948.  
  2949.  
  2950.  
  2951.  
  2952.  
  2953.  
  2954.  
  2955.  
  2956.                                                                             51
  2957.  
  2958.                                                      CPML  FUNCTION  REFERENCE
  2959.  
  2960.  
  2961.  
  2962.           Average
  2963.           Provides the integer average of the arguments.
  2964.           Syntax:
  2965.              Average (integer [, integer]...)
  2966.  
  2967.           Parameters:
  2968.              "integer" = integers to get the average of.
  2969.  
  2970.           Returns:
  2971.              (integer) average of the arguments.
  2972.  
  2973.           Use this command to compute the average of a series of numbers.
  2974.           This function returns an integer value, so there can be some
  2975.           rounding error involved.
  2976.  
  2977.  
  2978.           Errors:
  2979.              2060 "Average function syntax error"
  2980.  
  2981.           Example:
  2982.              Ave=Average(1,2,3,4,5,6,7,8,9,10,11,12,13)
  2983.              Message("The average is",Ave)
  2984.  
  2985.  
  2986.           See Also:
  2987.              Abs, Max, Min
  2988.  
  2989.  
  2990.  
  2991.  
  2992.  
  2993.  
  2994.  
  2995.  
  2996.  
  2997.  
  2998.  
  2999.  
  3000.  
  3001.  
  3002.  
  3003.  
  3004.  
  3005.  
  3006.  
  3007.  
  3008.  
  3009.  
  3010.  
  3011.  
  3012.                                                                             52
  3013.  
  3014.                                                      CPML  FUNCTION  REFERENCE
  3015.  
  3016.  
  3017.  
  3018.           Beep
  3019.           Beeps once.
  3020.  
  3021.           Syntax:
  3022.              Beep
  3023.  
  3024.  
  3025.           Use this command to produce a short beep, generally to alert the
  3026.           user to an error situation.
  3027.  
  3028.           Example:
  3029.              Beep
  3030.              Pause ("WARNING!!!", "You are about to destroy data!")
  3031.  
  3032.  
  3033.  
  3034.  
  3035.  
  3036.  
  3037.  
  3038.  
  3039.  
  3040.  
  3041.  
  3042.  
  3043.  
  3044.  
  3045.  
  3046.  
  3047.  
  3048.  
  3049.  
  3050.  
  3051.  
  3052.  
  3053.  
  3054.  
  3055.  
  3056.  
  3057.  
  3058.  
  3059.  
  3060.  
  3061.  
  3062.  
  3063.  
  3064.  
  3065.  
  3066.  
  3067.  
  3068.                                                                             53
  3069.  
  3070.                                                      CPML  FUNCTION  REFERENCE
  3071.  
  3072.  
  3073.  
  3074.           Char2Num
  3075.           Converts the first character of a string to its numeric equivalent.
  3076.  
  3077.           Syntax:
  3078.              Char2Num (string)
  3079.  
  3080.           Parameters:
  3081.              "string" =  any text string.  Only the first character will be
  3082.                        converted.
  3083.  
  3084.           Returns:
  3085.              (integer) ANSI character code.
  3086.  
  3087.           This function returns the 8-bit ANSI code corresponding to the
  3088.           first character of the string parameter.
  3089.  
  3090.           Note:  For the commonly-used characters (with codes below 128),
  3091.           ANSI and ASCII characters are identical.
  3092.  
  3093.           Example:
  3094.           ; Show the hex equivalent of entered character
  3095.           &Programming
  3096.            &ANSI Codes
  3097.              InpChar = AskLine("ANSI Equivalents", "Char:", "")
  3098.              Ansi = strsub(InpChar,1,1)
  3099.              AnsiEquiv = Char2Num(InpChar)
  3100.              Message("ANSI Codes","%Ansi% => %AnsiEquiv%")
  3101.  
  3102.  
  3103.           See Also:
  3104.              Num2Char
  3105.  
  3106.  
  3107.  
  3108.  
  3109.  
  3110.  
  3111.  
  3112.  
  3113.  
  3114.  
  3115.  
  3116.  
  3117.  
  3118.  
  3119.  
  3120.  
  3121.  
  3122.  
  3123.  
  3124.                                                                             54
  3125.  
  3126.                                                      CPML  FUNCTION  REFERENCE
  3127.  
  3128.  
  3129.  
  3130.           ClipAppend
  3131.           Appends a string to the Clipboard.
  3132.  
  3133.           Syntax:
  3134.              ClipAppend (string)
  3135.  
  3136.           Parameters:
  3137.              "string" =  text string to add to Clipboard.
  3138.  
  3139.           Returns:
  3140.              (integer) @TRUE if string was appended;
  3141.                        @FALSE if Clipboard ran out of memory.
  3142.  
  3143.           Use this command to append a string to the Windows Clipboard.  The
  3144.           Clipboard must either contain text data or be empty for this
  3145.           command to succeed.
  3146.  
  3147.  
  3148.           Example:
  3149.           ; The code below will append 2 copies of the Clipboard con-
  3150.           ; tents back to the Clipboard, resulting in 3 copies of the
  3151.           ; original contents with a CR/LF between each copy.
  3152.              a=clipget()
  3153.              crlf=strcat(num2char(13),num2char(10))
  3154.              clipappend(crlf)
  3155.              clipappend(a)
  3156.              clipappend(crlf)
  3157.              clipappend(a)
  3158.  
  3159.  
  3160.           See Also:
  3161.              ClipGet, ClipPut
  3162.  
  3163.  
  3164.  
  3165.  
  3166.  
  3167.  
  3168.  
  3169.  
  3170.  
  3171.  
  3172.  
  3173.  
  3174.  
  3175.  
  3176.  
  3177.  
  3178.  
  3179.  
  3180.                                                                             55
  3181.  
  3182.                                                      CPML  FUNCTION  REFERENCE
  3183.  
  3184.  
  3185.  
  3186.           ClipGet
  3187.           Returns the contents of the Clipboard.
  3188.  
  3189.           Syntax:
  3190.              ClipGet ( )
  3191.  
  3192.           Returns:
  3193.              (string)  clipboard contents.
  3194.  
  3195.           Use this command to copy text from the Windows Clipboard into a
  3196.           string variable.
  3197.  
  3198.           Note:  If the Clipboard contains an excessively large string a
  3199.           (fatal) out of memory error may occur.
  3200.  
  3201.           Example:
  3202.           ; The code below will convert Clipboard contents to uppercase:
  3203.              clipput(strupper(clipget()))
  3204.              a=clipget()
  3205.              message("UPPERCASE Clipboard Contents",a)
  3206.  
  3207.  
  3208.           See Also:
  3209.              ClipAppend, ClipPut
  3210.  
  3211.  
  3212.  
  3213.  
  3214.  
  3215.  
  3216.  
  3217.  
  3218.  
  3219.  
  3220.  
  3221.  
  3222.  
  3223.  
  3224.  
  3225.  
  3226.  
  3227.  
  3228.  
  3229.  
  3230.  
  3231.  
  3232.  
  3233.  
  3234.  
  3235.  
  3236.                                                                             56
  3237.  
  3238.                                                      CPML  FUNCTION  REFERENCE
  3239.  
  3240.  
  3241.  
  3242.           ClipPut
  3243.           Copies a string to the clipboard.
  3244.  
  3245.           Syntax:
  3246.              ClipPut (string)
  3247.  
  3248.           Parameters:
  3249.              "string" =  any text string.
  3250.  
  3251.           Returns:
  3252.              (integer) @TRUE if string was copied;
  3253.                        @FALSE if clipboard ran out of memory.
  3254.  
  3255.           Use this command to copy a string to the Windows Clipboard.  The
  3256.           previous Clipboard contents will be lost.
  3257.  
  3258.  
  3259.           Example:
  3260.           ; The code below will convert Clipboard contents to lowercase:
  3261.              clipput(strlower(clipget()))
  3262.              a = clipget ()
  3263.              message("lowercase Clipboard Contents",a)
  3264.  
  3265.  
  3266.           See Also:
  3267.              ClipAppend, ClipGet
  3268.  
  3269.  
  3270.  
  3271.  
  3272.  
  3273.  
  3274.  
  3275.  
  3276.  
  3277.  
  3278.  
  3279.  
  3280.  
  3281.  
  3282.  
  3283.  
  3284.  
  3285.  
  3286.  
  3287.  
  3288.  
  3289.  
  3290.  
  3291.  
  3292.                                                                             57
  3293.  
  3294.                                                      CPML  FUNCTION  REFERENCE
  3295.  
  3296.  
  3297.  
  3298.           CurrentFile
  3299.           Returns the selected filename.
  3300.  
  3301.           Syntax:
  3302.              CurrentFile ( )
  3303.  
  3304.           Returns:
  3305.              (string)  currently-selected file's name.
  3306.  
  3307.           When Command Post displays the files in the current directory, one
  3308.           of them is always selected.  It's the one with the dotted-line box
  3309.           around it.
  3310.  
  3311.           This is different than a "highlighted" file.  When a file is
  3312.           highlighted, it shows up in inverse video (usually white-on-black).
  3313.           To find the filenames that are highlighted, see FileItemize.
  3314.  
  3315.           Example:
  3316.           ; Ask which program to run (default = current file):
  3317.              TheFile = AskLine ("Run It", "Program:", CurrentFile())
  3318.              Run (TheFile, "")
  3319.  
  3320.  
  3321.           See Also:
  3322.              FileItemize, DirGet, DirItemize
  3323.  
  3324.  
  3325.  
  3326.  
  3327.  
  3328.  
  3329.  
  3330.  
  3331.  
  3332.  
  3333.  
  3334.  
  3335.  
  3336.  
  3337.  
  3338.  
  3339.  
  3340.  
  3341.  
  3342.  
  3343.  
  3344.  
  3345.  
  3346.  
  3347.  
  3348.                                                                             58
  3349.  
  3350.                                                      CPML  FUNCTION  REFERENCE
  3351.  
  3352.  
  3353.  
  3354.           DateTime
  3355.           Provides the current Date and time.
  3356.  
  3357.           Syntax:
  3358.              DateTime ( )
  3359.  
  3360.           Returns:
  3361.              (string)  Today's Date and time
  3362.  
  3363.           This function will return the current date and time in a pre-
  3364.           formatted string.  The format it is returned in depends on how it
  3365.           is set up in the international section of the WIN.INI file:
  3366.  
  3367.           ddd mm:dd:yy hh:mm:ss XX
  3368.           ddd dd:mm:yy hh:mm:ss XX
  3369.           ddd yy:mm:dd hh:mm:ss XX
  3370.           Where
  3371.              ddd is day of the week (e.g. Mon)
  3372.              mm  is the month (e.g. 10)
  3373.              dd  is the day of the month (e.g. 23)
  3374.              yy  is the year (e.g. 90)
  3375.              hh  is the hours
  3376.              mm  is the minutes
  3377.              ss  is the seconds
  3378.              XX  is the Day/Night code (e.g. AM or PM)
  3379.  
  3380.           Note:  Windows 3.0 provides even more formatting options than this.
  3381.           The WIN.INI file will be examined to determine which format to use.
  3382.           You can adjust the WIN.INI file via the International section of
  3383.           the Control Panel if the format isn't what you prefer.
  3384.  
  3385.  
  3386.           Example:
  3387.           ; assuming the current standard is U.S.
  3388.           ; (i.e. day  dd/mm/yy hh:mm:ss AM):
  3389.              Message("Current Date & Time",DateTime())
  3390.  
  3391.           would produce:
  3392.  
  3393.  
  3394.  
  3395.  
  3396.  
  3397.  
  3398.  
  3399.  
  3400.  
  3401.  
  3402.  
  3403.  
  3404.                                                                             59
  3405.  
  3406.                                                      CPML  FUNCTION  REFERENCE
  3407.  
  3408.  
  3409.  
  3410.           Debug
  3411.           Controls the debug mode.
  3412.  
  3413.           Syntax:
  3414.              Debug (mode)
  3415.  
  3416.           Parameters:
  3417.              "mode" =  @ON | @OFF
  3418.  
  3419.           Returns:
  3420.              (integer) Previous Debug mode
  3421.  
  3422.           Use this command to turn the debug mode on or off.  The default is
  3423.           @OFF.
  3424.  
  3425.           When Debug mode is on, Command Post will display the command just
  3426.           executed, its result (if any), any error conditions, and the next
  3427.           command to execute.
  3428.           The commands are displayed in a special dialog box.  As you can see
  3429.           in the Example section following, the dialog box gives the user
  3430.           four options:  Next, Run, Cancel and Show Var.
  3431.  
  3432.           Next executes the next statement and remains in debug mode.
  3433.           Run exits debug mode and runs the rest of the program normally.
  3434.  
  3435.           Cancel terminates the current menu item.
  3436.           Show Var displays the contents of a variable whose name the user
  3437.           entered in the edit box.
  3438.  
  3439.  
  3440.           Example:
  3441.           ; Debug example
  3442.              debug(@on)
  3443.              a = 6
  3444.              q = askyesno("Testing Debug Mode", "Is the Pope Catholic")
  3445.              debug(@off)
  3446.              b = a + 4
  3447.  
  3448.           produces:
  3449.  
  3450.  
  3451.  
  3452.  
  3453.  
  3454.  
  3455.  
  3456.  
  3457.  
  3458.  
  3459.  
  3460.                                                                             60
  3461.  
  3462.                                                      CPML  FUNCTION  REFERENCE
  3463.  
  3464.           ...then, if the user presses Next:
  3465.  
  3466.  
  3467.  
  3468.  
  3469.  
  3470.  
  3471.  
  3472.  
  3473.           ...and if the user presses Yes:
  3474.  
  3475.  
  3476.  
  3477.  
  3478.  
  3479.  
  3480.  
  3481.  
  3482.  
  3483.  
  3484.  
  3485.  
  3486.           ...etc.  (If the user had pressed No it would have said
  3487.           "VALUE=>0".)
  3488.  
  3489.  
  3490.           See Also:
  3491.              ErrorMode, LastError
  3492.  
  3493.  
  3494.  
  3495.  
  3496.  
  3497.  
  3498.  
  3499.  
  3500.  
  3501.  
  3502.  
  3503.  
  3504.  
  3505.  
  3506.  
  3507.  
  3508.  
  3509.  
  3510.  
  3511.  
  3512.  
  3513.  
  3514.  
  3515.  
  3516.                                                                             61
  3517.  
  3518.                                                      CPML  FUNCTION  REFERENCE
  3519.  
  3520.  
  3521.  
  3522.           Delay
  3523.           Pauses execution a specified amount of time.
  3524.  
  3525.           Syntax:
  3526.              Delay (seconds)
  3527.  
  3528.           Parameters:
  3529.              "seconds" = number of seconds to delay (2 - 15)
  3530.  
  3531.           Returns:
  3532.              (integer) always @TRUE
  3533.  
  3534.           Seconds must be between 2 and 15. Smaller or larger numbers will be
  3535.           adjusted accordingly.
  3536.  
  3537.  
  3538.           Example:
  3539.              Message("Wait","About 15 seconds")
  3540.              Delay(15)
  3541.              Message("Hi","I'm Baaaaaaack")
  3542.  
  3543.  
  3544.           See Also:
  3545.              Yield
  3546.  
  3547.  
  3548.  
  3549.  
  3550.  
  3551.  
  3552.  
  3553.  
  3554.  
  3555.  
  3556.  
  3557.  
  3558.  
  3559.  
  3560.  
  3561.  
  3562.  
  3563.  
  3564.  
  3565.  
  3566.  
  3567.  
  3568.  
  3569.  
  3570.  
  3571.  
  3572.                                                                             62
  3573.  
  3574.                                                      CPML  FUNCTION  REFERENCE
  3575.  
  3576.  
  3577.  
  3578.           DirChange
  3579.           Changes the current directory.  Can also log a new drive.
  3580.  
  3581.           Syntax:
  3582.              DirChange ([d:]path)
  3583.  
  3584.           Parameters:
  3585.              "[d:]" =  an optional disk drive to log onto.
  3586.              "path" =  the desired path.
  3587.  
  3588.           Returns:
  3589.              (integer) @TRUE if directory was changed;
  3590.                        @FALSE if the path could not be found.
  3591.  
  3592.           Use this command to change the current working directory to another
  3593.           directory, either on the same or a different disk drive.
  3594.  
  3595.  
  3596.           Errors:
  3597.              1031 "DirChange: Dir not found/changed"
  3598.  
  3599.           Example:
  3600.              DirChange("c:\")
  3601.              textbox("This is your CONFIG.SYS file", "config.sys")
  3602.  
  3603.  
  3604.           See Also:
  3605.              DirGet, DirHome, LogDisk
  3606.  
  3607.  
  3608.  
  3609.  
  3610.  
  3611.  
  3612.  
  3613.  
  3614.  
  3615.  
  3616.  
  3617.  
  3618.  
  3619.  
  3620.  
  3621.  
  3622.  
  3623.  
  3624.  
  3625.  
  3626.  
  3627.  
  3628.                                                                             63
  3629.  
  3630.                                                      CPML  FUNCTION  REFERENCE
  3631.  
  3632.  
  3633.  
  3634.           DirGet
  3635.           Gets the Current Working Directory.
  3636.  
  3637.           Syntax:
  3638.              DirGet ( )
  3639.  
  3640.           Returns:
  3641.              (string) =  Current Working Directory.
  3642.  
  3643.           Use this command to determine which directory we are currently in.
  3644.           It's especially useful when changing drives or directories
  3645.           temporarily.
  3646.  
  3647.  
  3648.           Example:
  3649.           ; Get, then restore current working directory
  3650.              OrigDir=DirGet()
  3651.              DirChange("c:\")
  3652.              FileCopy("config.sys","%OrigDir%xxxtemp.xyz", @FALSE)
  3653.              DirChange(OrigDir)
  3654.  
  3655.  
  3656.           See Also:
  3657.              DirHome, OtherDir
  3658.  
  3659.  
  3660.  
  3661.  
  3662.  
  3663.  
  3664.  
  3665.  
  3666.  
  3667.  
  3668.  
  3669.  
  3670.  
  3671.  
  3672.  
  3673.  
  3674.  
  3675.  
  3676.  
  3677.  
  3678.  
  3679.  
  3680.  
  3681.  
  3682.  
  3683.  
  3684.                                                                             64
  3685.  
  3686.                                                      CPML  FUNCTION  REFERENCE
  3687.  
  3688.  
  3689.  
  3690.           DirHome
  3691.           Returns directory containing the Command Post EXE file.
  3692.  
  3693.           Syntax:
  3694.              DirHome ( )
  3695.  
  3696.           Returns:
  3697.              (string)  pathname of the home directory.
  3698.  
  3699.           Use this command to determine the location of CMDPOST.EXE.
  3700.  
  3701.  
  3702.           Example:
  3703.              a=DirHome()
  3704.              Message("Command Post Executable is in ",a)
  3705.  
  3706.  
  3707.           See Also:
  3708.              DirGet, OtherDir
  3709.  
  3710.  
  3711.  
  3712.  
  3713.  
  3714.  
  3715.  
  3716.  
  3717.  
  3718.  
  3719.  
  3720.  
  3721.  
  3722.  
  3723.  
  3724.  
  3725.  
  3726.  
  3727.  
  3728.  
  3729.  
  3730.  
  3731.  
  3732.  
  3733.  
  3734.  
  3735.  
  3736.  
  3737.  
  3738.  
  3739.  
  3740.                                                                             65
  3741.  
  3742.                                                      CPML  FUNCTION  REFERENCE
  3743.  
  3744.  
  3745.  
  3746.           DirItemize
  3747.           Returns a space-delimited list of the highlighted directories.
  3748.  
  3749.           Syntax:
  3750.              DirItemize (dir-list)
  3751.  
  3752.           Parameters:
  3753.              "dir-list" =a string containing zero or more subdirectory names,
  3754.                        which may be wildcarded.
  3755.  
  3756.           Returns:
  3757.              (string)  list of directories.
  3758.  
  3759.           This function compiles a list of subdirectories and separates the
  3760.           names with spaces.
  3761.  
  3762.           Which directory names are itemized depends on the "dir-list"
  3763.           parameter:  If it is an empty string, all subdirectories
  3764.           highlighted in the Command Post file manager display are included.
  3765.           If there are any directory names or wildcards in the string, all
  3766.           subdirectories matching the pathnames are included regardless of
  3767.           which ones are highlighted.
  3768.           This is especially useful in conjunction with the ItemSelect
  3769.           function, which enables the user to choose an item from such a
  3770.           space-delimited list.
  3771.  
  3772.  
  3773.           Example:
  3774.              ;Verify directory selection:
  3775.              a=DirItemize("")
  3776.              ItemSelect("Directories", a, " ")
  3777.  
  3778.  
  3779.           See Also:
  3780.              FileItemize, WinItemize, ItemSelect
  3781.  
  3782.  
  3783.  
  3784.  
  3785.  
  3786.  
  3787.  
  3788.  
  3789.  
  3790.  
  3791.  
  3792.  
  3793.  
  3794.  
  3795.  
  3796.                                                                             66
  3797.  
  3798.                                                      CPML  FUNCTION  REFERENCE
  3799.  
  3800.  
  3801.  
  3802.           DirMake
  3803.           Creates a new directory.
  3804.  
  3805.           Syntax:
  3806.              DirMake ([d:]path)
  3807.  
  3808.           Parameters:
  3809.              "[d:]" =  the desired disk drive.
  3810.              "path" =  the path to create.
  3811.  
  3812.           Returns:
  3813.              (integer) @TRUE if the directory was successfully created;
  3814.                        @FALSE if it wasn't.
  3815.  
  3816.           Use this command to create a new directory.
  3817.  
  3818.  
  3819.           Errors:
  3820.              1029 "DirMake: Dir not created"
  3821.  
  3822.           Example:
  3823.              DirMake("c:\XXXSTUFF")
  3824.  
  3825.  
  3826.           See Also:
  3827.              DirRemove
  3828.  
  3829.  
  3830.  
  3831.  
  3832.  
  3833.  
  3834.  
  3835.  
  3836.  
  3837.  
  3838.  
  3839.  
  3840.  
  3841.  
  3842.  
  3843.  
  3844.  
  3845.  
  3846.  
  3847.  
  3848.  
  3849.  
  3850.  
  3851.  
  3852.                                                                             67
  3853.  
  3854.                                                      CPML  FUNCTION  REFERENCE
  3855.  
  3856.  
  3857.  
  3858.           DirRemove
  3859.           Removes a directory.
  3860.  
  3861.           Syntax:
  3862.              DirRemove (dir-list)
  3863.  
  3864.           Parameters:
  3865.              "dir-list" =a space-delimited list of directory pathnames.
  3866.  
  3867.           Returns:
  3868.              (integer) @TRUE if the directory was successfully removed;
  3869.                        @FALSE if it wasn't.
  3870.  
  3871.           Use this command to delete directories.  You can delete one or more
  3872.           at a time by separating directory names with spaces.  You cannot,
  3873.           however, use wildcards.
  3874.  
  3875.  
  3876.           Errors:
  3877.              1030 "DirRemove: Dir not removed"
  3878.  
  3879.           Example:
  3880.              DirRemove("c:\XXXSTUFF")
  3881.              DirRemove("tempdir1 tempdir2 tempdir3")
  3882.  
  3883.  
  3884.           See Also:
  3885.              DirMake
  3886.  
  3887.  
  3888.  
  3889.  
  3890.  
  3891.  
  3892.  
  3893.  
  3894.  
  3895.  
  3896.  
  3897.  
  3898.  
  3899.  
  3900.  
  3901.  
  3902.  
  3903.  
  3904.  
  3905.  
  3906.  
  3907.  
  3908.                                                                             68
  3909.  
  3910.                                                      CPML  FUNCTION  REFERENCE
  3911.  
  3912.  
  3913.  
  3914.           DiskFree
  3915.           Finds the total space available on a group of drives.
  3916.  
  3917.           Syntax:
  3918.              DiskFree (drive-list)
  3919.  
  3920.           Parameters:
  3921.              "drive-list" = at least one drive letter, separated by spaces.
  3922.  
  3923.           Returns:
  3924.              (integer) the number of bytes available on all the specified
  3925.                        drives.
  3926.  
  3927.           This function takes a string consisting of drive letters, separated
  3928.           by spaces.  Only the first character of each non-blank group of
  3929.           characters is used to determine the drives, so you can use just the
  3930.           drive letters, or add a colon (":"), or add a backslash ("\"), or
  3931.           even a whole pathname and still get a perfectly valid result.
  3932.  
  3933.  
  3934.           Example:
  3935.              Size = DiskFree ("c d")
  3936.              Message ("Space Available on C: & D:", Size)
  3937.  
  3938.  
  3939.           See Also:
  3940.              FileSize
  3941.  
  3942.  
  3943.  
  3944.  
  3945.  
  3946.  
  3947.  
  3948.  
  3949.  
  3950.  
  3951.  
  3952.  
  3953.  
  3954.  
  3955.  
  3956.  
  3957.  
  3958.  
  3959.  
  3960.  
  3961.  
  3962.  
  3963.  
  3964.                                                                             69
  3965.  
  3966.                                                      CPML  FUNCTION  REFERENCE
  3967.  
  3968.  
  3969.  
  3970.           Display
  3971.           Displays a message to the user for a specified time.
  3972.  
  3973.           Syntax:
  3974.              Display (seconds, title, text)
  3975.  
  3976.           Parameters:
  3977.              "seconds" = integer seconds to display the message (1-15).
  3978.              "title" = Title of the window to be displayed.
  3979.              "text" =  Text of the window to be displayed.
  3980.  
  3981.           Returns:
  3982.              (integer) always @TRUE.
  3983.  
  3984.           Use this command to display a message for a few seconds, and then
  3985.           continue with processing without user input.
  3986.  
  3987.           The display box may be prematurely canceled by the user by clicking
  3988.           it with a mouse, or hitting any character.
  3989.  
  3990.           Example:
  3991.              name=askline("Desserts", "Please enter your name", "")
  3992.              dsrt=askline("Desserts", "Favorite dessert?", "Ice Cream")
  3993.              display(3,"%name%'s Dessert", dsrt)
  3994.  
  3995.           ...If Jennifer likes pudding, the display statement produces:
  3996.  
  3997.  
  3998.  
  3999.  
  4000.  
  4001.  
  4002.           See Also:
  4003.              Pause, Message, Terminate
  4004.  
  4005.  
  4006.  
  4007.  
  4008.  
  4009.  
  4010.  
  4011.  
  4012.  
  4013.  
  4014.  
  4015.  
  4016.  
  4017.  
  4018.  
  4019.  
  4020.                                                                             70
  4021.  
  4022.                                                      CPML  FUNCTION  REFERENCE
  4023.  
  4024.  
  4025.  
  4026.           Drop
  4027.           Removes variables from memory.
  4028.  
  4029.           Syntax:
  4030.              Drop (var, [var]...)
  4031.  
  4032.           Parameters:
  4033.              var =     variable names to remove.
  4034.  
  4035.           Returns:
  4036.              (integer) @TRUE.
  4037.  
  4038.           This function removes variables from the language processor's
  4039.           variable list, and recovers the memory associated with the variable
  4040.           (and possibly related string storage).
  4041.  
  4042.  
  4043.           Example:
  4044.              A="A variable"
  4045.              B="Another one"
  4046.  
  4047.              Drop(A,B)   ; This removes A and B from memory
  4048.  
  4049.  
  4050.  
  4051.  
  4052.  
  4053.  
  4054.  
  4055.  
  4056.  
  4057.  
  4058.  
  4059.  
  4060.  
  4061.  
  4062.  
  4063.  
  4064.  
  4065.  
  4066.  
  4067.  
  4068.  
  4069.  
  4070.  
  4071.  
  4072.  
  4073.  
  4074.  
  4075.  
  4076.                                                                             71
  4077.  
  4078.                                                      CPML  FUNCTION  REFERENCE
  4079.  
  4080.  
  4081.  
  4082.           EndSession
  4083.           Ends the Windows session.
  4084.  
  4085.           Syntax:
  4086.              EndSession ( )
  4087.  
  4088.           Use this command to end the Windows session.  This command is
  4089.           equivalent to closing the MS-DOS Executive window in Windows v2.x,
  4090.           or the Program Manager window in Windows v3.0.
  4091.  
  4092.  
  4093.           Example:
  4094.           &Utilities
  4095.            E&xit Windows
  4096.              Sure = AskYesNo ("End Session", "You SURE you want to
  4097.                                            exit Windows?")
  4098.              Terminate (Sure==@No, "", "Exit Windows cancelled")
  4099.              EndSession ()
  4100.  
  4101.  
  4102.           See Also:
  4103.              Exit, Terminate, WinClose, WinCloseNot
  4104.  
  4105.  
  4106.  
  4107.  
  4108.  
  4109.  
  4110.  
  4111.  
  4112.  
  4113.  
  4114.  
  4115.  
  4116.  
  4117.  
  4118.  
  4119.  
  4120.  
  4121.  
  4122.  
  4123.  
  4124.  
  4125.  
  4126.  
  4127.  
  4128.  
  4129.  
  4130.  
  4131.  
  4132.                                                                             72
  4133.  
  4134.                                                      CPML  FUNCTION  REFERENCE
  4135.  
  4136.  
  4137.  
  4138.           Environment
  4139.           Gets a DOS environment variable.
  4140.  
  4141.           Syntax:
  4142.              Environment (env-variable)
  4143.  
  4144.           Parameters:
  4145.              "env-variable" = any defined environment variable.
  4146.  
  4147.           Returns:
  4148.              (string)  environment variable contents.
  4149.  
  4150.           Use this command to query the DOS environment.
  4151.  
  4152.  
  4153.           Example:
  4154.           &MsDos Utilities
  4155.            Display &Path
  4156.              ;Display the PATH for this DOS session...
  4157.              CurrPath=Environment("PATH")
  4158.              Message ("Current DOS Path", CurrPath)
  4159.  
  4160.  
  4161.           See Also:
  4162.              IniRead, Version, WinVersion
  4163.  
  4164.  
  4165.  
  4166.  
  4167.  
  4168.  
  4169.  
  4170.  
  4171.  
  4172.  
  4173.  
  4174.  
  4175.  
  4176.  
  4177.  
  4178.  
  4179.  
  4180.  
  4181.  
  4182.  
  4183.  
  4184.  
  4185.  
  4186.  
  4187.  
  4188.                                                                             73
  4189.  
  4190.                                                      CPML  FUNCTION  REFERENCE
  4191.  
  4192.  
  4193.  
  4194.           ErrorMode
  4195.           Specifies how to handle errors.
  4196.  
  4197.           Syntax:
  4198.              ErrorMode (mode)
  4199.  
  4200.           Parameters:
  4201.              "mode" =  @CANCEL, @NOTIFY, or @OFF.
  4202.  
  4203.           Returns:
  4204.              (integer) previous error setting.
  4205.  
  4206.           Use this command to control the effects of runtime errors.  The
  4207.           default is @CANCEL, meaning the execution of the menu item will be
  4208.           cancelled for any error.
  4209.  
  4210.           @CANCEL:  All runtime errors will cause execution to be cancelled.
  4211.           The user will be notified which error occurred.
  4212.           @NOTIFY:  All runtime errors will be reported to the user, and they
  4213.           can choose to continue if it isn't fatal.
  4214.  
  4215.           @OFF:  Minor runtime errors will be suppressed. Moderate and fatal
  4216.           errors will be reported to the user.  User has the option of
  4217.           continuing if the error is not fatal.
  4218.           In general we suggest the normal state of the program should be
  4219.           ErrorMode(@CANCEL), especially if you are writing a menu for others
  4220.           to use.  You can always suppress errors you expect will occur and
  4221.           then re-enable ErrorMode (@CANCEL).
  4222.  
  4223.  
  4224.           Example:
  4225.           ; Delete xxxtest.xyz.
  4226.           ; If file doesn't exist, continue execution; don't stop:
  4227.              PrevErrMode=ErrorMode(@off)
  4228.              FileDelete("c:\xxxtest.xyz")
  4229.              ErrorMode(PrevErrMode)
  4230.  
  4231.  
  4232.           See Also:
  4233.              Debug, LastError
  4234.  
  4235.  
  4236.  
  4237.  
  4238.  
  4239.  
  4240.  
  4241.  
  4242.  
  4243.  
  4244.                                                                             74
  4245.  
  4246.                                                      CPML  FUNCTION  REFERENCE
  4247.  
  4248.  
  4249.  
  4250.           Execute
  4251.           Executes a statement in a protected environment.  Any errors
  4252.           encountered are recoverable.
  4253.  
  4254.           Syntax:
  4255.              Execute statement
  4256.  
  4257.           Parameters:
  4258.              "statement" =  is (hopefully) an executable statement.
  4259.  
  4260.           Use this command to execute computed or user-entered statements.
  4261.           Due to the built-in error recovery associated with the Execute
  4262.           statement, it is ideal for interactive execution of user-entered
  4263.           commands.
  4264.  
  4265.           Note the Execute statement doesn't operate on a string per se, but
  4266.           rather on a direct statement.  If you want to put a code segment
  4267.           into a string variable you must use the substitution feature of the
  4268.           language, as in the example below.
  4269.  
  4270.           Example:
  4271.              CPMLCmd="" ;in autoexec section in beginning
  4272.              . . .
  4273.           &System
  4274.            CP Menu Language Interactive
  4275.              CPMLCmd=AskLine("CPML Interactive","Command:",CPMLCmd)
  4276.              execute %CPMLCmd%
  4277.  
  4278.  
  4279.  
  4280.  
  4281.  
  4282.  
  4283.  
  4284.  
  4285.  
  4286.  
  4287.  
  4288.  
  4289.  
  4290.  
  4291.  
  4292.  
  4293.  
  4294.  
  4295.  
  4296.  
  4297.  
  4298.  
  4299.  
  4300.                                                                             75
  4301.  
  4302.                                                      CPML  FUNCTION  REFERENCE
  4303.  
  4304.  
  4305.  
  4306.           Exit
  4307.           Terminates the menu item being interpreted.
  4308.  
  4309.           Syntax:
  4310.              Exit
  4311.  
  4312.           Use this command to prematurely exit a menu process.  An exit is
  4313.           implied at the end of each menu item.
  4314.  
  4315.  
  4316.           Example:
  4317.              a = 100
  4318.              message("The value of a is",a)
  4319.              exit
  4320.  
  4321.  
  4322.           See Also:
  4323.              Pause
  4324.  
  4325.  
  4326.  
  4327.  
  4328.  
  4329.  
  4330.  
  4331.  
  4332.  
  4333.  
  4334.  
  4335.  
  4336.  
  4337.  
  4338.  
  4339.  
  4340.  
  4341.  
  4342.  
  4343.  
  4344.  
  4345.  
  4346.  
  4347.  
  4348.  
  4349.  
  4350.  
  4351.  
  4352.  
  4353.  
  4354.  
  4355.  
  4356.                                                                             76
  4357.  
  4358.                                                      CPML  FUNCTION  REFERENCE
  4359.  
  4360.  
  4361.  
  4362.           FileCopy
  4363.           Copies files.
  4364.  
  4365.           Syntax:
  4366.              FileCopy (source-list, destination, warning)
  4367.  
  4368.           Parameters:
  4369.              "source-list" =  a string containing one or more filenames,
  4370.                        which may be wildcarded.
  4371.              "destination" =  target file name.
  4372.  
  4373.              "warning" = @TRUE if you want a warning before
  4374.                        overwriting existing files;
  4375.                        @FALSE if no warning desired.
  4376.  
  4377.           Returns:
  4378.              (integer)   @TRUE if all files were copied successfully;
  4379.                        @FALSE if at least one file wasn't copied.
  4380.  
  4381.           Use this command to copy an individual file, a group of files using
  4382.           wildcards, or several groups of files by separating the names with
  4383.           spaces.
  4384.  
  4385.           You can also copy files to any COM or LPT device.
  4386.           "Source-list" may contain * and ? wildcards.  "Destination" may
  4387.           contain the * wildcard only.
  4388.  
  4389.  
  4390.           Errors:
  4391.              1006 "File Copy/Move: No matching files found"
  4392.              2002 "File Copy/Move: 'From' file illegal"
  4393.              2003 "File Copy/Move: 'To'   file illegal"
  4394.              2004 "File Copy/Move: Cannot copy/move wildcards into fixed root"
  4395.              2005 "File Copy/Move: Cannot copy/move wildcards into fixed
  4396.                   extension"
  4397.              3118 "FileCopyMove: Destination file same as source"
  4398.  
  4399.           Examples:
  4400.              FileCopy("c:\config.sys","d:", @FALSE)
  4401.              FileCopy("c:\*.sys","d:devices\*.sys", @TRUE)
  4402.              FileCopy("c:\config.sys","LPT1:", @FALSE)
  4403.  
  4404.  
  4405.           See Also:
  4406.              FileDelete, FileExist, FileLocate, FileMove, FileRename
  4407.  
  4408.  
  4409.  
  4410.  
  4411.  
  4412.                                                                             77
  4413.  
  4414.                                                      CPML  FUNCTION  REFERENCE
  4415.  
  4416.  
  4417.  
  4418.           FileDelete
  4419.           Deletes files.
  4420.  
  4421.           Syntax:
  4422.              FileDelete (file-list)
  4423.  
  4424.           Parameters:
  4425.              "file-list" =  a string containing one or more filenames, which
  4426.                        may be wildcarded.
  4427.  
  4428.           Returns:
  4429.              (integer) @TRUE if all the files were deleted;
  4430.                        @FALSE if a file didn't exist or is marked with the
  4431.                        READ-ONLY attribute.
  4432.  
  4433.           Use this command to delete an individual file, a group of files
  4434.           using wildcards, or several groups of files by separating the names
  4435.           with spaces.
  4436.  
  4437.  
  4438.           Errors:
  4439.              1017 "File Delete: No matching files found"
  4440.              1018 "File Delete: Delete Failed"
  4441.              2016 "File Delete: File name illegal"
  4442.  
  4443.           Example:
  4444.              WasDeleted = FileDelete ("BadFile")
  4445.  
  4446.  
  4447.           See Also:
  4448.              FileExist, FileLocate, FileMove, FileRename
  4449.  
  4450.  
  4451.  
  4452.  
  4453.  
  4454.  
  4455.  
  4456.  
  4457.  
  4458.  
  4459.  
  4460.  
  4461.  
  4462.  
  4463.  
  4464.  
  4465.  
  4466.  
  4467.  
  4468.                                                                             78
  4469.  
  4470.                                                      CPML  FUNCTION  REFERENCE
  4471.  
  4472.  
  4473.  
  4474.           FileExist
  4475.           Tests for the existence of files.
  4476.  
  4477.           Syntax:
  4478.              FileExist (filename)
  4479.  
  4480.           Parameters:
  4481.              "filename" =either a fully qualified filename with drive and
  4482.                        path, or just a filename and extension.
  4483.  
  4484.           Returns:
  4485.              (integer) @YES if the file exists;
  4486.                        @NO if it doesn't or if the pathname is invalid.
  4487.  
  4488.           This statement is used to test whether or not a specified file
  4489.           exists.
  4490.  
  4491.           If a fully qualified file name is used only the specified drive and
  4492.           directory will be checked for the desired file.  If only the root
  4493.           and extension are specified, then all the directories in the DOS
  4494.           PATH statement will be searched for the desired file.
  4495.  
  4496.           Example:
  4497.              ; check for file in current directory
  4498.              Fex=FileExist(strcat(DirGet(),"myfile.txt"))
  4499.              Tex=substr("NOT",1,strlen("NOT")*Fex)
  4500.              Message("MyFile.Txt"," Is %Tex%in the current directory")
  4501.  
  4502.              ; check for file in someplace along path
  4503.              Fex=FileExist("myfile.txt")
  4504.              Tex=substr("NOT",1,strlen("NOT")*Fex)
  4505.  
  4506.              Message("MyFile.Txt"," Is %Tex% in the DOS path")
  4507.  
  4508.  
  4509.           See Also:
  4510.              FileLocate
  4511.  
  4512.  
  4513.  
  4514.  
  4515.  
  4516.  
  4517.  
  4518.  
  4519.  
  4520.  
  4521.  
  4522.  
  4523.  
  4524.                                                                             79
  4525.  
  4526.                                                      CPML  FUNCTION  REFERENCE
  4527.  
  4528.  
  4529.  
  4530.           FileItemize
  4531.           Returns a space-delimited list of files.
  4532.  
  4533.           Syntax:
  4534.              FileItemize (file-list)
  4535.  
  4536.           Parameters:
  4537.              "file-list" =  a string containing zero or more filenames, which
  4538.                        may be wildcarded.
  4539.  
  4540.           Returns:
  4541.              (string)  space-delimited list of files.
  4542.  
  4543.           This function compiles a list of filenames and separates the names
  4544.           with spaces.
  4545.  
  4546.           Which filenames are itemized depends on the "file-list" parameter:
  4547.           If it is an empty string, all filenames highlighted in the Command
  4548.           Post file manager display are included.  If there are any filenames
  4549.           or wildcards in the string, all files matching the filenames are
  4550.           included regardless of which ones are highlighted.
  4551.           This is especially useful in conjunction with the ItemSelect
  4552.           function, which enables the user to choose an item from such a
  4553.           space-delimited list.
  4554.  
  4555.  
  4556.           Examples:
  4557.            &Edit INI files
  4558.              ;Get which .INI file to edit (meaningful in Win 3.0 only):
  4559.              IFiles= FileItemize("c:\windows\*.ini")
  4560.              IFile = ItemSelect(".INI Files",IFiles, " ")
  4561.              RunZoom ("Notepad", IFile)
  4562.              Drop (IFiles, IFile)
  4563.  
  4564.  
  4565.           See Also:
  4566.              DirItemize, WinItemize, ItemSelect
  4567.  
  4568.  
  4569.  
  4570.  
  4571.  
  4572.  
  4573.  
  4574.  
  4575.  
  4576.  
  4577.  
  4578.  
  4579.  
  4580.                                                                             80
  4581.  
  4582.                                                      CPML  FUNCTION  REFERENCE
  4583.  
  4584.  
  4585.  
  4586.           FileLocate
  4587.           Finds file in current directory or along the DOS PATH.
  4588.  
  4589.           Syntax:
  4590.              FileLocate (filename)
  4591.  
  4592.           Parameters:
  4593.              "filename" =root name, ".", and an extension.
  4594.  
  4595.           Returns:
  4596.              (string)  fully qualified path name.
  4597.  
  4598.           This function is used to obtain the fully qualified path name of a
  4599.           file.  The current directory is checked first, and if the file is
  4600.           not found the DOS path is searched.  This function returns the
  4601.           first occurrence of the file.
  4602.  
  4603.  
  4604.           Example:
  4605.            Edit &WIN.INI
  4606.              winini=FileLocate("win.ini")
  4607.              Terminate(winini=="","???","WIN.INI not found")
  4608.              Run("notepad.exe",winini)
  4609.              Exit
  4610.  
  4611.  
  4612.           See Also:
  4613.              FileExist
  4614.  
  4615.  
  4616.  
  4617.  
  4618.  
  4619.  
  4620.  
  4621.  
  4622.  
  4623.  
  4624.  
  4625.  
  4626.  
  4627.  
  4628.  
  4629.  
  4630.  
  4631.  
  4632.  
  4633.  
  4634.  
  4635.  
  4636.                                                                             81
  4637.  
  4638.                                                      CPML  FUNCTION  REFERENCE
  4639.  
  4640.  
  4641.  
  4642.           FileMove
  4643.           Moves files.
  4644.  
  4645.           Syntax:
  4646.              FileMove (source-list, destination, warning)
  4647.  
  4648.           Parameters:
  4649.              "source-list" =  one or more filenames separated by spaces.
  4650.              "destination" =  target filename.
  4651.              "warning" = @TRUE if you want a warning before overwriting
  4652.                        existing files;
  4653.                        @FALSE if no warning desired.
  4654.  
  4655.           Returns:
  4656.              (integer) @TRUE if the file was moved;
  4657.                        @FALSE if the source file was not found or had the
  4658.                        READ-ONLY attribute, or the target filename is invalid.
  4659.  
  4660.           Use this command to move an individual file, a group of files using
  4661.           wildcards, or several groups of files by separating the names with
  4662.           spaces.
  4663.  
  4664.           You can also move files to another drive, or to any COM or LPT
  4665.           device.
  4666.           "Source-list" may contain * and ? wildcards.  "Destination" may
  4667.           contain the * wildcard only.
  4668.  
  4669.  
  4670.           Errors:
  4671.              1006 "File Copy/Move: No matching files found"
  4672.              2002 "File Copy/Move: 'From' file illegal"
  4673.              2003 "File Copy/Move: 'To'   file illegal"
  4674.              2004 "File Copy/Move: Cannot copy/move wildcards into fixed root"
  4675.              2005 "File Copy/Move: Cannot copy/move wildcards into fixed
  4676.                   extension"
  4677.              2007 "File Move: Unable to rename source file"
  4678.              2015 "File Move:  Unable to remove source file"
  4679.  
  4680.           Example:
  4681.              FileMove("c:\config.sys","d:", @FALSE)
  4682.              FileMove("c:\*.sys","d:*.sys", @TRUE)
  4683.  
  4684.  
  4685.           See Also:
  4686.              FileCopy, FileDelete, FileExist, FileLocate, FileRename
  4687.  
  4688.  
  4689.  
  4690.  
  4691.  
  4692.                                                                             82
  4693.  
  4694.                                                      CPML  FUNCTION  REFERENCE
  4695.  
  4696.  
  4697.  
  4698.           FileRename
  4699.           Renames files.
  4700.  
  4701.           Syntax:
  4702.              FileRename (source-list, destination)
  4703.  
  4704.           Parameters:
  4705.              "source-list" =  one or more filenames separated by spaces.
  4706.              "destination" =  target filename.
  4707.  
  4708.           Returns:
  4709.              (integer) @TRUE if the file was renamed;
  4710.                        @FALSE if the source file was not found or had the
  4711.                        READ-ONLY attribute, or the target filename is invalid.
  4712.  
  4713.           Use this command to rename an individual file, a group of files
  4714.           using wildcards, or several groups of files by separating the names
  4715.           with spaces.
  4716.  
  4717.           Note: Unlike FileMove, you cannot make a file change its resident
  4718.           disk drive with FileRename.
  4719.           "Source-list" may contain * and ? wildcards.  "Destination" may
  4720.           contain the * wildcard only.
  4721.  
  4722.  
  4723.           Errors:
  4724.              1024 "File Rename: No matching files found"
  4725.              1025 "File Rename: Rename failed"
  4726.              2019 "File Rename: 'From' file illegal"
  4727.              2020 "File Rename: 'To' file illegal"
  4728.              2021 "File Rename: Attempt to rename across drive boundary. - Use
  4729.                   MOVE instead."
  4730.              2022 "File Rename: Cannot rename wildcards into a fixed filename
  4731.                   root"
  4732.              2023 "File Rename: Cannot rename wildcards into a fixed filename
  4733.                   extension"
  4734.  
  4735.           Example:
  4736.              FileRename("c:\config.sys","config.old")
  4737.              FileRename("c:\*.txt","*.bak")
  4738.  
  4739.  
  4740.           See Also:
  4741.              FileCopy, FileExist, FileLocate, FileMove
  4742.  
  4743.  
  4744.  
  4745.  
  4746.  
  4747.  
  4748.                                                                             83
  4749.  
  4750.                                                      CPML  FUNCTION  REFERENCE
  4751.  
  4752.  
  4753.  
  4754.           FileSize
  4755.           Finds the total size of a group of files.
  4756.  
  4757.           Syntax:
  4758.              FileSize (file-list)
  4759.  
  4760.           Parameters:
  4761.              "file-list" =  zero or more filenames, separated by spaces.
  4762.  
  4763.           Returns:
  4764.              (integer) total bytes taken up by the specified files.
  4765.  
  4766.           This function returns the total size of the specified files.  Note
  4767.           it doesn't handle wildcarded filenames.  You can, however, use
  4768.           FileItemize on a wildcarded filename and use the resulting string
  4769.           with as a FileSize parameter.
  4770.  
  4771.  
  4772.           Errors:
  4773.              3112 "FileSize:  File Not Found"
  4774.  
  4775.           Example:
  4776.              Size = FileSize (FileItemize(""))
  4777.              Message ("Size of Highlighted Files", Size)
  4778.  
  4779.  
  4780.           See Also:
  4781.              DiskFree
  4782.  
  4783.  
  4784.  
  4785.  
  4786.  
  4787.  
  4788.  
  4789.  
  4790.  
  4791.  
  4792.  
  4793.  
  4794.  
  4795.  
  4796.  
  4797.  
  4798.  
  4799.  
  4800.  
  4801.  
  4802.  
  4803.  
  4804.                                                                             84
  4805.  
  4806.                                                      CPML  FUNCTION  REFERENCE
  4807.  
  4808.  
  4809.  
  4810.           IniRead
  4811.           Reads data from the WIN.INI file.
  4812.  
  4813.           Syntax:
  4814.              IniRead (section, keyname, default)
  4815.  
  4816.           Parameters:
  4817.              "section" = the major heading to read the data from.
  4818.              "keyname =  the name of the item to read.
  4819.              "default" = string to return if the desired item is not found.
  4820.  
  4821.           Returns:
  4822.              (string)  data from WIN.INI file.
  4823.  
  4824.           This command allows a program to read data from the WIN.INI file.
  4825.  
  4826.           The WIN.INI file has the form:
  4827.              [section]
  4828.              keyname=settings
  4829.  
  4830.           Most of the entries in WIN.INI are set from the Windows Control
  4831.           Panel program, but individual applications can also use it to store
  4832.           option settings in their own sections.
  4833.  
  4834.  
  4835.           Example:
  4836.              ;Find the default output device:
  4837.              a=IniRead("windows","device","No Default")
  4838.              Message("Default Output Device",a)
  4839.  
  4840.  
  4841.           See Also:
  4842.              Environment, IniWrite
  4843.  
  4844.  
  4845.  
  4846.  
  4847.  
  4848.  
  4849.  
  4850.  
  4851.  
  4852.  
  4853.  
  4854.  
  4855.  
  4856.  
  4857.  
  4858.  
  4859.  
  4860.                                                                             85
  4861.  
  4862.                                                      CPML  FUNCTION  REFERENCE
  4863.  
  4864.  
  4865.  
  4866.           IniWrite
  4867.           Writes data to the WIN.INI file.
  4868.  
  4869.           Syntax:
  4870.              IniWrite (section, keyname, data)
  4871.  
  4872.           Parameters:
  4873.              "section" = major heading to write the data to.
  4874.              "keyname =  name of the data item to write.
  4875.              "data" =  string to write to the WIN.INI file.
  4876.  
  4877.           Returns:
  4878.              (integer) always @TRUE.
  4879.  
  4880.           This command allows a program to write data to the WIN.INI file.
  4881.           The "section" is added to the file if it doesn't already exist.
  4882.  
  4883.  
  4884.           Example:
  4885.           &WIN.INI Stuff
  4886.            Modify &LOAD= line
  4887.              ;Change the list of pgms to load upon Windows startup:
  4888.              LoadProgs = IniRead("windows","load","")
  4889.              NewProgs=AskLine("Add Pgm To LOAD= Line", "Add:", LoadProgs)
  4890.              IniWrite("windows","load",NewProgs)
  4891.  
  4892.  
  4893.           See Also:
  4894.              IniRead
  4895.  
  4896.  
  4897.  
  4898.  
  4899.  
  4900.  
  4901.  
  4902.  
  4903.  
  4904.  
  4905.  
  4906.  
  4907.  
  4908.  
  4909.  
  4910.  
  4911.  
  4912.  
  4913.  
  4914.  
  4915.  
  4916.                                                                             86
  4917.  
  4918.                                                      CPML  FUNCTION  REFERENCE
  4919.  
  4920.  
  4921.  
  4922.           IsDefined
  4923.           Determines if a variable name is currently defined.
  4924.  
  4925.           Syntax:
  4926.              IsDefined (var)
  4927.  
  4928.           Parameters:
  4929.              "var" =   a variable name.
  4930.  
  4931.           Returns:
  4932.              (integer) @YES if the variable is currently defined;
  4933.                        @NO if it was never defined or has been dropped.
  4934.  
  4935.           A variable is defined the first time it appears at the left of an
  4936.           equal sign in a statement.  It stays defined until it is explicitly
  4937.           Dropped.
  4938.  
  4939.  
  4940.           Example:
  4941.              Def = IsDefined (ThisVar)
  4942.              Terminate (Def==@FALSE, "ERROR!", "Variable not defined")
  4943.  
  4944.  
  4945.           See Also:
  4946.              Drop
  4947.  
  4948.  
  4949.  
  4950.  
  4951.  
  4952.  
  4953.  
  4954.  
  4955.  
  4956.  
  4957.  
  4958.  
  4959.  
  4960.  
  4961.  
  4962.  
  4963.  
  4964.  
  4965.  
  4966.  
  4967.  
  4968.  
  4969.  
  4970.  
  4971.  
  4972.                                                                             87
  4973.  
  4974.                                                      CPML  FUNCTION  REFERENCE
  4975.  
  4976.  
  4977.  
  4978.           IsMenuChecked
  4979.           Determines if a menuitem has a checkmark next to it.
  4980.  
  4981.           Syntax:
  4982.              IsMenuChecked (menuname)
  4983.  
  4984.           Parameters:
  4985.              "menuname" =name of the menu item to test.
  4986.  
  4987.           Returns:
  4988.              (integer) @YES if the menuitem has a checkmark;
  4989.                        @NO if it doesn't.
  4990.  
  4991.           You can place a checkmark next to a menu item with the MenuChange
  4992.           command, to indicate an option has been enabled.  This function
  4993.           lets you determine if the menu item has already been checked or
  4994.           not.
  4995.  
  4996.  
  4997.           Example:
  4998.              ;Assume we've defined a "Misc./Prompt Often" menuitem...
  4999.              Prompt = IsMenuChecked ("MiscPromptOften")
  5000.              IfPrompt = substr(";",1,(Prompt==@FALSE))
  5001.              execute %IfPrompt% Confirm = AskYesNo ("???", "Do you REALLY
  5002.                                         want to do this?")
  5003.              execute %IfPrompt% Terminate (Confirm!=@YES, "", "")
  5004.              ;some risky operation the user has just confirmed they want
  5005.              ;to carry out...
  5006.  
  5007.  
  5008.           See Also:
  5009.              IsMenuEnabled, MenuChange
  5010.  
  5011.  
  5012.  
  5013.  
  5014.  
  5015.  
  5016.  
  5017.  
  5018.  
  5019.  
  5020.  
  5021.  
  5022.  
  5023.  
  5024.  
  5025.  
  5026.  
  5027.  
  5028.                                                                             88
  5029.  
  5030.                                                      CPML  FUNCTION  REFERENCE
  5031.  
  5032.  
  5033.  
  5034.           IsMenuEnabled
  5035.           Determines if a menuitem has been enabled.
  5036.  
  5037.           Syntax:
  5038.              IsMenuEnabled (menuname)
  5039.  
  5040.           Parameters:
  5041.              "menuname" =name of the menu item to test.
  5042.  
  5043.           Returns:
  5044.              (integer) @YES if the menuitem is enabled;
  5045.                        @NO if it is disabled & grayed.
  5046.  
  5047.           You can disable a menu item with the MenuChange command if you want
  5048.           to prevent the user from choosing it.  It shows up on the screen as
  5049.           a grayed item.  IsMenuEnabled lets you determine if the menu item
  5050.           is currently enabled or not.
  5051.  
  5052.  
  5053.           Example:
  5054.              ;Allow editing of autoexec.bat file only if choice enabled
  5055.              Terminate (!IsMenuEnabled("UtilitiesEditBatFile"), "", "")
  5056.              Run ("Notepad.exe", "c:\autoexec.bat")
  5057.  
  5058.  
  5059.           See Also:
  5060.              IsMenuChecked, MenuChange
  5061.  
  5062.  
  5063.  
  5064.  
  5065.  
  5066.  
  5067.  
  5068.  
  5069.  
  5070.  
  5071.  
  5072.  
  5073.  
  5074.  
  5075.  
  5076.  
  5077.  
  5078.  
  5079.  
  5080.  
  5081.  
  5082.  
  5083.  
  5084.                                                                             89
  5085.  
  5086.                                                      CPML  FUNCTION  REFERENCE
  5087.  
  5088.  
  5089.  
  5090.           IsNumber
  5091.           Determines whether a variable contains a valid number.
  5092.  
  5093.           Syntax:
  5094.              IsNumber (string)
  5095.  
  5096.           Parameters:
  5097.              "string" =  string to test to see if it represents a valid
  5098.                        number.
  5099.  
  5100.           Returns:
  5101.              (integer) @YES if it contains a valid number;
  5102.                        @NO if it doesn't.
  5103.  
  5104.           This function determines if a string variable contains a valid
  5105.           integer.  Useful for checking user input prior to using it in
  5106.           computations.
  5107.  
  5108.  
  5109.           Example:
  5110.              a = AskLine("ISNUMBER","Enter a number","0")
  5111.              Terminate(!IsNumber(a),"", "You didn't enter a number")
  5112.  
  5113.  
  5114.           See Also:
  5115.              Abs, Char2Num
  5116.  
  5117.  
  5118.  
  5119.  
  5120.  
  5121.  
  5122.  
  5123.  
  5124.  
  5125.  
  5126.  
  5127.  
  5128.  
  5129.  
  5130.  
  5131.  
  5132.  
  5133.  
  5134.  
  5135.  
  5136.  
  5137.  
  5138.  
  5139.  
  5140.                                                                             90
  5141.  
  5142.                                                      CPML  FUNCTION  REFERENCE
  5143.  
  5144.  
  5145.  
  5146.           IsRunning
  5147.           Determines if another copy of Command Post is currently running.
  5148.  
  5149.           Syntax:
  5150.              IsRunning ( )
  5151.  
  5152.           Returns:
  5153.              (integer) @YES if another copy of Command Post is running;
  5154.                        @NO if this is the only one.
  5155.  
  5156.           There is no artificial restraint on the number of copies of Command
  5157.           Post you may run at once.
  5158.  
  5159.  
  5160.           Example:
  5161.              a=!(IsRunning())
  5162.              Is = strsub("not ", 1, 4*a)
  5163.              Message ("", "Another Command Post is %Is% running.")
  5164.              Drop (a, Is)
  5165.  
  5166.  
  5167.           See Also:
  5168.              OtherDir, OtherUpdate
  5169.  
  5170.  
  5171.  
  5172.  
  5173.  
  5174.  
  5175.  
  5176.  
  5177.  
  5178.  
  5179.  
  5180.  
  5181.  
  5182.  
  5183.  
  5184.  
  5185.  
  5186.  
  5187.  
  5188.  
  5189.  
  5190.  
  5191.  
  5192.  
  5193.  
  5194.  
  5195.  
  5196.                                                                             91
  5197.  
  5198.                                                      CPML  FUNCTION  REFERENCE
  5199.  
  5200.  
  5201.  
  5202.           ItemSelect
  5203.           Allows the user to choose an item from a listbox.
  5204.  
  5205.           Syntax:
  5206.              ItemSelect (title, list, delimiter)
  5207.  
  5208.           Parameters:
  5209.              "title" = the title of dialog box to display.
  5210.              "list" =  a string containing a list of items to choose from.
  5211.              "delimiter" =  a string containing the character to act as
  5212.                        delimiter between items in the list.
  5213.  
  5214.           Returns:
  5215.              (string)  the selected item.
  5216.  
  5217.           This function displays a dialog box with a listbox inside.  This
  5218.           listbox is filled with a list of items taken from a string you
  5219.           provide to the function.
  5220.  
  5221.           Each item in the string must be separated ("delimited") by a
  5222.           character, which you also pass to the function.
  5223.           The user selects one of the items by either doubleclicking on it,
  5224.           or single-clicking and pressing OK.  The item is returned as a
  5225.           string.
  5226.  
  5227.           If you create the list with the FileItemize or DirItemize functions
  5228.           you will be using a space-delimited list.  WinItemize, however,
  5229.           creates a tab-delimited list of window titles since titles can have
  5230.           embedded blanks.
  5231.  
  5232.           Example:
  5233.           &Graphics
  5234.            &PC Paintbrush
  5235.              Files = FileItemize("*.bmp")
  5236.              TheFile = ItemSelect("Bitmap Files",Files, " ")
  5237.              Run("pbrush.exe", TheFile)
  5238.  
  5239.           would produce (depending on what's in the current directory):
  5240.  
  5241.  
  5242.  
  5243.  
  5244.  
  5245.  
  5246.  
  5247.  
  5248.  
  5249.  
  5250.  
  5251.  
  5252.                                                                             92
  5253.  
  5254.                                                      CPML  FUNCTION  REFERENCE
  5255.  
  5256.  
  5257.  
  5258.  
  5259.  
  5260.  
  5261.  
  5262.  
  5263.  
  5264.  
  5265.  
  5266.  
  5267.  
  5268.  
  5269.  
  5270.  
  5271.  
  5272.           See Also:
  5273.              AskYesNo, Display,  DirItemize, FileItemize, WinItemize, Message,
  5274.              Pause, TextBox
  5275.  
  5276.  
  5277.  
  5278.  
  5279.  
  5280.  
  5281.  
  5282.  
  5283.  
  5284.  
  5285.  
  5286.  
  5287.  
  5288.  
  5289.  
  5290.  
  5291.  
  5292.  
  5293.  
  5294.  
  5295.  
  5296.  
  5297.  
  5298.  
  5299.  
  5300.  
  5301.  
  5302.  
  5303.  
  5304.  
  5305.  
  5306.  
  5307.  
  5308.                                                                             93
  5309.  
  5310.                                                      CPML  FUNCTION  REFERENCE
  5311.  
  5312.  
  5313.  
  5314.           LastError
  5315.           Returns the most-recent error encountered during the current menu
  5316.           item.
  5317.  
  5318.           Syntax:
  5319.              LastError ( )
  5320.  
  5321.           Returns:
  5322.              (integer) most-recent CPML error code encountered.
  5323.  
  5324.           CPML errors are numbered according to their severity.  "Minor"
  5325.           errors go from 1000 through 1999.  Moderate errors are 2000 through
  5326.           2999.  Fatal errors are numbered 3000 to 3999.
  5327.  
  5328.           Depending on which error mode is active when an error occurs, you
  5329.           may not get a chance to check the error code.  See ErrorMode for a
  5330.           discussion of default error handling.
  5331.           Don't bother checking for "fatal" error codes.  When a fatal error
  5332.           occurs, the menu item is cancelled before the next CPML statement
  5333.           gets to execute (regardless of which error mode is active).
  5334.  
  5335.           Calling LastError itself resets the last error indicator back to
  5336.           zero.
  5337.           A full listing of possible errors you can encounter in processing a
  5338.           menu item is in Appendix E - Errors.
  5339.  
  5340.  
  5341.           Example:
  5342.              ErrorMode (@OFF)
  5343.              FileCopy ("Data.dat", "c:\backups", @FALSE)
  5344.              ErrorMode (@CANCEL)
  5345.              Terminate (LastError()==1006,"Error","Please call
  5346.                                  Tech Support at 555-9999.")
  5347.  
  5348.           See Also:
  5349.              Debug, ErrorMode
  5350.  
  5351.  
  5352.  
  5353.  
  5354.  
  5355.  
  5356.  
  5357.  
  5358.  
  5359.  
  5360.  
  5361.  
  5362.  
  5363.  
  5364.                                                                             94
  5365.  
  5366.                                                      CPML  FUNCTION  REFERENCE
  5367.  
  5368.  
  5369.  
  5370.           LogDisk
  5371.           Logs (activates) a disk drive.
  5372.  
  5373.           Syntax:
  5374.              LogDisk (drive-letter)
  5375.  
  5376.           Parameters:
  5377.              "drive-letter" = is the disk drive to log into.
  5378.  
  5379.           Returns:
  5380.              (integer) @TRUE if the current drive was changed;
  5381.                        @FALSE if the drive doesn't exist.
  5382.  
  5383.           Use this command to change the logged disk drive.
  5384.  
  5385.           This command produces the same effect as if you typed the drive
  5386.           name from the DOS command prompt.
  5387.  
  5388.           Errors:
  5389.              1028 "LogDisk: Requested drive not online"
  5390.  
  5391.           Example:
  5392.              logdisk("c:")
  5393.  
  5394.  
  5395.           See Also:
  5396.              DirChange
  5397.  
  5398.  
  5399.  
  5400.  
  5401.  
  5402.  
  5403.  
  5404.  
  5405.  
  5406.  
  5407.  
  5408.  
  5409.  
  5410.  
  5411.  
  5412.  
  5413.  
  5414.  
  5415.  
  5416.  
  5417.  
  5418.  
  5419.  
  5420.                                                                             95
  5421.  
  5422.                                                      CPML  FUNCTION  REFERENCE
  5423.  
  5424.  
  5425.  
  5426.           Max
  5427.           Returns largest number in a list of numbers.
  5428.  
  5429.           Syntax:
  5430.              Max (integer [, integer]...)
  5431.  
  5432.           Parameters:
  5433.              "integer" = number.
  5434.  
  5435.           Returns:
  5436.              (integer) largest parameter.
  5437.  
  5438.           Use this function to determine the largest of a set of numbers.
  5439.  
  5440.  
  5441.           Example:
  5442.              a=Max(5, -37, 125, 34, 2345, -32767)
  5443.              Message("Largest number is",a)
  5444.  
  5445.  
  5446.           See Also:
  5447.              Abs, Average, Min
  5448.  
  5449.  
  5450.  
  5451.  
  5452.  
  5453.  
  5454.  
  5455.  
  5456.  
  5457.  
  5458.  
  5459.  
  5460.  
  5461.  
  5462.  
  5463.  
  5464.  
  5465.  
  5466.  
  5467.  
  5468.  
  5469.  
  5470.  
  5471.  
  5472.  
  5473.  
  5474.  
  5475.  
  5476.                                                                             96
  5477.  
  5478.                                                      CPML  FUNCTION  REFERENCE
  5479.  
  5480.  
  5481.  
  5482.           MenuChange
  5483.           Checks, unchecks, enables, or disables a menu item.
  5484.  
  5485.           Syntax:
  5486.              MenuChange (menuname, flags)
  5487.  
  5488.           Parameters:
  5489.              "menuname" =menu item whose status you wish to change.
  5490.              "flags" = @CHECK, @UNCHECK,
  5491.                        @ENABLE, or @DISABLE.
  5492.  
  5493.           Returns:
  5494.              (integer) always @TRUE.
  5495.  
  5496.           There are currently two ways you can modify a menu item:
  5497.  
  5498.           You can check and uncheck the item to imply that it corresponds to
  5499.           an option that can be turned on or off.
  5500.           You can temporarily disable the item (it shows up as gray) and
  5501.           later re-enable it.
  5502.  
  5503.           The two sets of flags (@Check/@UnCheck and @Enable/@Disable) can be
  5504.           combined in one function call by using the | (or) operator.
  5505.  
  5506.           Example:
  5507.              MenuChange (FilePrint, @Disable)
  5508.              MenuChange (WPWrite, @Enable|@Check)
  5509.  
  5510.  
  5511.           See Also:
  5512.              IsMenuChecked, IsMenuEnabled
  5513.  
  5514.  
  5515.  
  5516.  
  5517.  
  5518.  
  5519.  
  5520.  
  5521.  
  5522.  
  5523.  
  5524.  
  5525.  
  5526.  
  5527.  
  5528.  
  5529.  
  5530.  
  5531.  
  5532.                                                                             97
  5533.  
  5534.                                                      CPML  FUNCTION  REFERENCE
  5535.  
  5536.  
  5537.  
  5538.           Message
  5539.           Displays a message to the user.
  5540.  
  5541.           Syntax:
  5542.              Message (title, text)
  5543.  
  5544.           Parameters:
  5545.              "title" = title of the message box.
  5546.              "text" =  text to display in the message box.
  5547.  
  5548.           Returns:
  5549.              (integer) always @TRUE.
  5550.  
  5551.           Use this command to display a message to the user.  The user must
  5552.           respond by selecting the OK button before processing will continue.
  5553.  
  5554.  
  5555.           Example:
  5556.              Message("GUESSIT","Pick a number   between one and 100")
  5557.              Message("GUESSIT","Multiply your number by 2")
  5558.              Message("GUESSIT","Add 34")
  5559.              Message("GUESSIT","Divide by 2")
  5560.              Message("GUESSIT","Subtract your original number")
  5561.              Message("GUESSIT","Your answer is 17")
  5562.  
  5563.           produces:
  5564.  
  5565.  
  5566.  
  5567.  
  5568.  
  5569.  
  5570.  
  5571.  
  5572.           See Also:
  5573.              Display, Pause, Terminate
  5574.  
  5575.  
  5576.  
  5577.  
  5578.  
  5579.  
  5580.  
  5581.  
  5582.  
  5583.  
  5584.  
  5585.  
  5586.  
  5587.  
  5588.                                                                             98
  5589.  
  5590.                                                      CPML  FUNCTION  REFERENCE
  5591.  
  5592.  
  5593.  
  5594.           Min
  5595.           Returns lowest number in a list of numbers.
  5596.  
  5597.           Syntax:
  5598.              Min (integer [, integer]...)
  5599.  
  5600.           Parameters:
  5601.              "integer" = any integer number.
  5602.  
  5603.           Returns:
  5604.              (integer) lowest parameter.
  5605.  
  5606.           Use this function to determine the lowest of a set of integers.
  5607.  
  5608.  
  5609.           Example:
  5610.              a=Min( 5, -37, 125, 34, 2345, -32767)
  5611.              Message("Smallest number is",a)
  5612.  
  5613.  
  5614.           See Also:
  5615.              Abs, Average, Max
  5616.  
  5617.  
  5618.  
  5619.  
  5620.  
  5621.  
  5622.  
  5623.  
  5624.  
  5625.  
  5626.  
  5627.  
  5628.  
  5629.  
  5630.  
  5631.  
  5632.  
  5633.  
  5634.  
  5635.  
  5636.  
  5637.  
  5638.  
  5639.  
  5640.  
  5641.  
  5642.  
  5643.  
  5644.                                                                             99
  5645.  
  5646.                                                      CPML  FUNCTION  REFERENCE
  5647.  
  5648.  
  5649.  
  5650.           #NextFile
  5651.  
  5652.           Syntax:
  5653.              #NextFile  filename
  5654.  
  5655.           The #NextFile directive tells the CPML interpreter to append
  5656.           another.CPM file to the current one before building the menus.  In
  5657.           this manner you can build a common menu for a group of users, for
  5658.           example, and include a #NextFile directive to allow each user to
  5659.           customize part of their menus to suit their individual needs.  The
  5660.           default menu file CMDPOST.CPM calls the default user menu
  5661.           CMDUSER.CPM in just this way.
  5662.           #NextFile should appear only once in a menu file, as CPML only acts
  5663.           upon the first one it sees.  Also, you can only link one user menu
  5664.           in this manner.
  5665.  
  5666.  
  5667.           Example:
  5668.           ;(beginning of CMDPOST.CPM file)
  5669.           ;changed this directive to point to my own menu file
  5670.           ;instead of the default "cmduser.cpm":
  5671.           #NextFile MyOwn.cpm
  5672.              . . .
  5673.  
  5674.  
  5675.  
  5676.  
  5677.  
  5678.  
  5679.  
  5680.  
  5681.  
  5682.  
  5683.  
  5684.  
  5685.  
  5686.  
  5687.  
  5688.  
  5689.  
  5690.  
  5691.  
  5692.  
  5693.  
  5694.  
  5695.  
  5696.  
  5697.  
  5698.  
  5699.  
  5700.                                                                            100
  5701.  
  5702.                                                      CPML  FUNCTION  REFERENCE
  5703.  
  5704.  
  5705.  
  5706.           Num2Char
  5707.           Converts a number to its character equivalent.
  5708.  
  5709.           Syntax:
  5710.              Num2Char (integer)
  5711.  
  5712.           Parameters:
  5713.              "number" =  any number from 0 to 255.
  5714.  
  5715.           Returns:
  5716.              (string)  one-byte string containing the character the number
  5717.                        represents.
  5718.  
  5719.           Use this command to convert a number to its ASCII equivalent.
  5720.  
  5721.  
  5722.           Example:
  5723.              ; Build a variable containing a CRLF combo
  5724.              crlf=strcat(num2char(13),num2char(10))
  5725.              message("NUM2CHAR",strcat("line1",crlf,"line2"))
  5726.  
  5727.  
  5728.           See Also:
  5729.              Char2Num
  5730.  
  5731.  
  5732.  
  5733.  
  5734.  
  5735.  
  5736.  
  5737.  
  5738.  
  5739.  
  5740.  
  5741.  
  5742.  
  5743.  
  5744.  
  5745.  
  5746.  
  5747.  
  5748.  
  5749.  
  5750.  
  5751.  
  5752.  
  5753.  
  5754.  
  5755.  
  5756.                                                                            101
  5757.  
  5758.                                                      CPML  FUNCTION  REFERENCE
  5759.  
  5760.  
  5761.  
  5762.           OtherDir
  5763.           Finds the directory where the other copy of Command Post is
  5764.           running, if any.
  5765.  
  5766.           Syntax:
  5767.              OtherDir ( )
  5768.  
  5769.           Parameters:
  5770.              "string" =  pathname to "other" directory.
  5771.  
  5772.           Returns:
  5773.              (string)  the directory of the second-most recently used Command
  5774.                        Post window.  The current window is considered the most
  5775.                        recently used directory.
  5776.  
  5777.           Use this command to determine directory of the other Command Post
  5778.           window.  Useful in setting up copy and move operations between two
  5779.           Command Post copies.
  5780.  
  5781.  
  5782.           Example:
  5783.              a=DirGet()
  5784.              b=OtherDir()
  5785.              Message("Directory of this CmdPost window is",a)
  5786.              Message("Directory of the other CmdPost window is",b)
  5787.  
  5788.  
  5789.           See Also:
  5790.              DirGet, DirHome, OtherUpdate
  5791.  
  5792.  
  5793.  
  5794.  
  5795.  
  5796.  
  5797.  
  5798.  
  5799.  
  5800.  
  5801.  
  5802.  
  5803.  
  5804.  
  5805.  
  5806.  
  5807.  
  5808.  
  5809.  
  5810.  
  5811.  
  5812.                                                                            102
  5813.  
  5814.                                                      CPML  FUNCTION  REFERENCE
  5815.  
  5816.  
  5817.  
  5818.           OtherUpdate
  5819.           Updates another Command Post directory display.
  5820.  
  5821.           Syntax:
  5822.              OtherUpdate ( )
  5823.  
  5824.           Returns:
  5825.              (integer)   @TRUE if another copy of Command Post was found to
  5826.                        update;
  5827.                        @FALSE if this is the only copy running.
  5828.  
  5829.           This command updates the File Manager display of the next-most
  5830.           recently invoked copy of Command Post.  This is useful if your menu
  5831.           item changes a directory; i.e. if a file or directory is created,
  5832.           moved, renamed, or deleted.  OtherUpdate helps ensure the other
  5833.           Command Post display immediately reflects the change the user
  5834.           caused from this copy.
  5835.  
  5836.  
  5837.           Example:
  5838.              FileCopy ("MyFile.txt", OtherDir(), @FALSE)
  5839.              OtherUpdate ()
  5840.  
  5841.  
  5842.           See Also:
  5843.              OtherDir, SetDisplay
  5844.  
  5845.  
  5846.  
  5847.  
  5848.  
  5849.  
  5850.  
  5851.  
  5852.  
  5853.  
  5854.  
  5855.  
  5856.  
  5857.  
  5858.  
  5859.  
  5860.  
  5861.  
  5862.  
  5863.  
  5864.  
  5865.  
  5866.  
  5867.  
  5868.                                                                            103
  5869.  
  5870.                                                      CPML  FUNCTION  REFERENCE
  5871.  
  5872.  
  5873.  
  5874.           Pause
  5875.           Provides a message to user.  User may cancel processing.
  5876.  
  5877.           Syntax:
  5878.              Pause (title, text)
  5879.  
  5880.           Parameters:
  5881.              "title" = title of pause box.
  5882.              "text" =  text of the message to be displayed.
  5883.  
  5884.           Returns:
  5885.              (integer)   always @TRUE.
  5886.  
  5887.           This command displays a message to the user with an exclamation
  5888.           point icon.  The user may respond by selecting the OK button, or
  5889.           they may cancel the processing by selecting CANCEL.
  5890.  
  5891.           The Pause command is similar to the Message command except for the
  5892.           addition of the CANCEL button and icon.
  5893.  
  5894.           Example:
  5895.              Pause("Change Disks","Insert new disk into Drive A:")
  5896.  
  5897.           produces:
  5898.  
  5899.  
  5900.  
  5901.  
  5902.  
  5903.  
  5904.  
  5905.  
  5906.  
  5907.  
  5908.           See Also:
  5909.              Display, Message, Terminate
  5910.  
  5911.  
  5912.  
  5913.  
  5914.  
  5915.  
  5916.  
  5917.  
  5918.  
  5919.  
  5920.  
  5921.  
  5922.  
  5923.  
  5924.                                                                            104
  5925.  
  5926.                                                      CPML  FUNCTION  REFERENCE
  5927.  
  5928.  
  5929.  
  5930.           Random
  5931.           Computes a pseudo-random number.
  5932.  
  5933.           Syntax:
  5934.              Random (max)
  5935.  
  5936.           Parameters:
  5937.              "max" =   largest desired number.
  5938.  
  5939.           Returns:
  5940.              (integer) unpredictable positive number.
  5941.  
  5942.           This function will return a random integer between 0 and "max".
  5943.  
  5944.  
  5945.           Example:
  5946.           a = Random(79)
  5947.           Message("Random number between 0 and 79",a)
  5948.  
  5949.  
  5950.  
  5951.  
  5952.  
  5953.  
  5954.  
  5955.  
  5956.  
  5957.  
  5958.  
  5959.  
  5960.  
  5961.  
  5962.  
  5963.  
  5964.  
  5965.  
  5966.  
  5967.  
  5968.  
  5969.  
  5970.  
  5971.  
  5972.  
  5973.  
  5974.  
  5975.  
  5976.  
  5977.  
  5978.  
  5979.  
  5980.                                                                            105
  5981.  
  5982.                                                      CPML  FUNCTION  REFERENCE
  5983.  
  5984.  
  5985.  
  5986.           Run
  5987.           Runs a program as a normal window.
  5988.  
  5989.           Syntax:
  5990.              Run (program-name, parameters)
  5991.  
  5992.           Parameters:
  5993.              "program-name" =the name of the desired .EXE, .COM, .PIF, .BAT
  5994.                        file, or a data file.
  5995.              "parameters" = optional parameters as required by the applica-
  5996.                        tion.
  5997.  
  5998.           Returns:
  5999.              (integer) @TRUE if the program was found;
  6000.                        @FALSE if it wasn't.
  6001.  
  6002.           Use this command to run an application.
  6003.  
  6004.           If the drive and path are not part of the program name, the current
  6005.           directory will be examined first and then the DOS path will be
  6006.           searched to find the desired executable file.
  6007.           If the "program-name" doesn't have an extension of .EXE, .COM,
  6008.           .PIF, or .BAT, it will be run in accordance with whatever is in the
  6009.           [extensions] section of the WIN.INI file.  When this happens, any
  6010.           "parameters" you specified are ignored.
  6011.  
  6012.  
  6013.           Examples:
  6014.              Run("Notepad.exe","abc.txt")
  6015.              Run("clock.exe","")
  6016.              Run("paint.exe","pict.msp")
  6017.  
  6018.  
  6019.           See Also:
  6020.              RunHide, RunIcon, RunZoom, WinClose, WinWaitClose
  6021.  
  6022.  
  6023.  
  6024.  
  6025.  
  6026.  
  6027.  
  6028.  
  6029.  
  6030.  
  6031.  
  6032.  
  6033.  
  6034.  
  6035.  
  6036.                                                                            106
  6037.  
  6038.                                                      CPML  FUNCTION  REFERENCE
  6039.  
  6040.  
  6041.  
  6042.           RunHide
  6043.           Runs a program as a hidden window.
  6044.  
  6045.           Syntax:
  6046.              RunHide (program-name, parameters)
  6047.  
  6048.           Parameters:
  6049.              "program-name" =the name of the desired .EXE, .COM, .PIF, .BAT
  6050.                        file, or a data file.
  6051.              "parameters" = optional parameters as required by the
  6052.                        application.
  6053.  
  6054.           Returns:
  6055.              (integer) @TRUE if the program was found;
  6056.                        @FALSE if it wasn't.
  6057.  
  6058.           Use this command to run an application as a hidden window.
  6059.  
  6060.           If the drive and path are not part of the program name, the current
  6061.           directory will be examined first and then the DOS path will be
  6062.           searched to find the desired executable file.
  6063.           If the "program-name" doesn't have an extension of .EXE, .COM,
  6064.           .PIF, or .BAT, it will be run in accordance with whatever is in the
  6065.           [extensions] section of the WIN.INI file.  When this happens, any
  6066.           "parameters" you specified are ignored.
  6067.  
  6068.           Note:  When this command launches an application it informs it that
  6069.           you want it to run as a hidden window.  Whether or not the
  6070.           application honors your wish is beyond RunHide's control.
  6071.  
  6072.           Examples:
  6073.              RunHide("Notepad.exe","abc.txt")
  6074.              RunHide("clock.exe","")
  6075.              RunHide("paint.exe","pict.msp")
  6076.  
  6077.  
  6078.           See Also:
  6079.              Run, RunIcon, RunZoom, WinHide, WinClose, WinWaitClose
  6080.  
  6081.  
  6082.  
  6083.  
  6084.  
  6085.  
  6086.  
  6087.  
  6088.  
  6089.  
  6090.  
  6091.  
  6092.                                                                            107
  6093.  
  6094.                                                      CPML  FUNCTION  REFERENCE
  6095.  
  6096.  
  6097.  
  6098.           RunIcon
  6099.           Runs a program as an iconic (minimized) window.
  6100.  
  6101.           Syntax:
  6102.              RunIcon (program-name, parameters)
  6103.  
  6104.           Parameters:
  6105.              "program-name" =the name of the desired .EXE, .COM, .PIF, .BAT
  6106.                        file, or a data file.
  6107.              "parameters" = optional parameters as required by the
  6108.                        application.
  6109.  
  6110.           Returns:
  6111.              (integer) @TRUE if the program was found;
  6112.                        @FALSE if it wasn't.
  6113.  
  6114.           Use this command to run an application as an icon.
  6115.  
  6116.           If the drive and path are not part of the program name, the current
  6117.           directory will be examined first and then the DOS path will be
  6118.           searched to find the desired executable file.
  6119.           If the "program-name" doesn't have an extension of .EXE, .COM,
  6120.           .PIF, or .BAT, it will be run in accordance with whatever is in the
  6121.           [extensions] section of the WIN.INI file.  When this happens, any
  6122.           "parameters" you specified are ignored.
  6123.  
  6124.           Note:  When this command launches an application it merely informs
  6125.           it that you want it to begin as an icon.  Whether or not the
  6126.           application honors your wish is beyond RunIcon's control.
  6127.  
  6128.           Examples:
  6129.              RunIcon("Notepad.exe","abc.txt")
  6130.              RunIcon("clock.exe","")
  6131.              RunIcon("paint.exe","pict.msp")
  6132.  
  6133.  
  6134.           See Also:
  6135.              Run, RunHide, RunZoom, WinIconize, WinClose, WinWaitClose
  6136.  
  6137.  
  6138.  
  6139.  
  6140.  
  6141.  
  6142.  
  6143.  
  6144.  
  6145.  
  6146.  
  6147.  
  6148.                                                                            108
  6149.  
  6150.                                                      CPML  FUNCTION  REFERENCE
  6151.  
  6152.  
  6153.  
  6154.           RunZoom
  6155.           Runs a program as a full-screen (maximized) window.
  6156.  
  6157.           Syntax:
  6158.              RunZoom (program-name, parameters)
  6159.  
  6160.           Parameters:
  6161.              "program-name" =the name of the desired .EXE, .COM, .PIF, .BAT
  6162.                        file, or a data file.
  6163.              "parameters" = optional parameters as required by the
  6164.                        application.
  6165.  
  6166.           Returns:
  6167.              (integer) @TRUE if the program was found;
  6168.                        @FALSE if it wasn't.
  6169.  
  6170.           Use this command to run an application as a full-screen window.
  6171.  
  6172.           If the drive and path are not part of the program name, the current
  6173.           directory will be examined first and then the DOS path will be
  6174.           searched to find the desired executable file.
  6175.           If the "program-name" doesn't have an extension of .EXE, .COM,
  6176.           .PIF, or .BAT, it will be run in accordance with whatever is in the
  6177.           [extensions] section of the WIN.INI file.  When this happens, any
  6178.           "parameters" you specified are ignored.
  6179.  
  6180.           Note:  When this command launches an application it merely informs
  6181.           it that you want it to be maximized to full-screen.  Whether or not
  6182.           the application honors your wish is beyond RunZoom's control.
  6183.  
  6184.           Examples:
  6185.              RunZoom("Notepad.exe","abc.txt")
  6186.              RunZoom("clock.exe","")
  6187.              RunZoom("paint.exe","pict.msp")
  6188.  
  6189.  
  6190.           See Also:
  6191.              Run, RunHide, RunIcon, WinZoom, WinClose, WinWaitClose
  6192.  
  6193.  
  6194.  
  6195.  
  6196.  
  6197.  
  6198.  
  6199.  
  6200.  
  6201.  
  6202.  
  6203.  
  6204.                                                                            109
  6205.  
  6206.                                                      CPML  FUNCTION  REFERENCE
  6207.  
  6208.  
  6209.  
  6210.           SetDisplay
  6211.           Controls the display of files in the Command Post File Manager
  6212.           window.
  6213.  
  6214.           Syntax:
  6215.              SetDisplay (detail, sort-by, masks)
  6216.  
  6217.           Parameters:
  6218.              "detail" =  level of detail.  Use "SHORT" or "LONG".
  6219.              "sort-by" = how to sort the filenames.  Use "NAME", "KIND",
  6220.                        "SIZE", "DATE" or "UNSORTED".
  6221.              "masks" = list of masks for file display.
  6222.  
  6223.           Returns:
  6224.              (integer) @TRUE if valid options were specified;
  6225.                        @FALSE if invalid.
  6226.  
  6227.           Use this command to change and/or update the file display.
  6228.  
  6229.           Any of the fields may be null.  If a field is null the previous
  6230.           setting is used.  This command will alter the file display
  6231.           Parameters:, and then re-read all the files and update the display.
  6232.           A special form of this command, SETDISPLAY ("","",""), will update
  6233.           the file display without changing any of the previously set
  6234.           Parameters.
  6235.  
  6236.  
  6237.           Errors:
  6238.              2105 "SetDisplay: Display type not SHORT or LONG"
  6239.              2106 "SetDisplay: Sort Type not NAME, DATE, SIZE, KIND, or
  6240.                   UNSORTED"
  6241.  
  6242.           Example:
  6243.           Windows &SDK
  6244.            &Show SDK Development Files
  6245.              SetDisplay ("","","*.ICO *.CUR *.BMP *.DLG *.H")
  6246.  
  6247.  
  6248.  
  6249.  
  6250.  
  6251.  
  6252.  
  6253.  
  6254.  
  6255.  
  6256.  
  6257.  
  6258.  
  6259.  
  6260.                                                                            110
  6261.  
  6262.                                                      CPML  FUNCTION  REFERENCE
  6263.  
  6264.  
  6265.  
  6266.           StrCat
  6267.           Concatenates two or more strings.
  6268.  
  6269.           Syntax:
  6270.              StrCat (string1, string2[, stringN]...)
  6271.  
  6272.           Parameters:
  6273.              "string1", etc = at least two strings you want to "string"
  6274.                        together (so to speak).
  6275.  
  6276.           Returns:
  6277.              (string)  concatenation of the entire list of input strings.
  6278.  
  6279.           Use this command to stick character strings together, or to format
  6280.           display messages.
  6281.  
  6282.  
  6283.           Errors:
  6284.              2058 "StrCat function syntax error"
  6285.  
  6286.           Example:
  6287.              User=AskLine("Login", "Your Name:", "")
  6288.              Message("Login",strcat("Hi, ",User))
  6289.              ;note that this will do the same:
  6290.              Message("Login","Hi, %User%")
  6291.  
  6292.  
  6293.           See Also:
  6294.              StrFill, StrFix, StrTrim
  6295.  
  6296.  
  6297.  
  6298.  
  6299.  
  6300.  
  6301.  
  6302.  
  6303.  
  6304.  
  6305.  
  6306.  
  6307.  
  6308.  
  6309.  
  6310.  
  6311.  
  6312.  
  6313.  
  6314.  
  6315.  
  6316.                                                                            111
  6317.  
  6318.                                                      CPML  FUNCTION  REFERENCE
  6319.  
  6320.  
  6321.  
  6322.           StrCmp
  6323.           Compares two strings.
  6324.  
  6325.           Syntax:
  6326.              StrCmp (string1, string2)
  6327.  
  6328.           Parameters:
  6329.              "string1", "string2" =
  6330.                        strings to compare.
  6331.  
  6332.           Returns:
  6333.              (integer) -1, 0, or 1; depending on whether string1 is less than,
  6334.                        equal to, or greater than string2, respectively.
  6335.  
  6336.           Use this command to determine whether two strings are equal, or
  6337.           which precedes the other in an ASCII sorting sequence.
  6338.  
  6339.           Note:  This command has been included for semantic completeness.
  6340.           The relational operators >, >=, ==, !=, <=, and < provide the same
  6341.           capability.
  6342.  
  6343.           Example:
  6344.              a=AskLine("STRCMP","Enter a test line","")
  6345.              b=AskLine("STRCMP","Enter another test line","")
  6346.              c=strcmp(a,b)
  6347.              c=c+1
  6348.              d=strsub("less than   equal to    greater than",c*12,12)
  6349.              ;Note that above string is grouped into 12-character chunks.
  6350.              ;Desired chunk is removed with the strsub statement.
  6351.              message("STRCMP","%a% is %d% %b%")
  6352.  
  6353.  
  6354.           See Also:
  6355.              StrICmp, StrIndex, StrLen, StrScan, StrSub
  6356.  
  6357.  
  6358.  
  6359.  
  6360.  
  6361.  
  6362.  
  6363.  
  6364.  
  6365.  
  6366.  
  6367.  
  6368.  
  6369.  
  6370.  
  6371.  
  6372.                                                                            112
  6373.  
  6374.                                                      CPML  FUNCTION  REFERENCE
  6375.  
  6376.  
  6377.  
  6378.           StrFill
  6379.           Creates a string filled with a series of characters.
  6380.  
  6381.           Syntax:
  6382.              StrFill (filler, length)
  6383.  
  6384.           Parameters:
  6385.              "filler" =  a string to be repeated to create the return string.
  6386.                        If the filler string is null, spaces will be used
  6387.                        instead.
  6388.              "length" =  the length of the desired string.
  6389.  
  6390.  
  6391.           Returns:
  6392.              (string)  character string.
  6393.  
  6394.           Use this function to create a string consisting of multiple copies
  6395.           of the filler string concatenated together.
  6396.  
  6397.           Example:
  6398.              Message("My Stars",strfill("*",30))
  6399.  
  6400.  
  6401.           See Also:
  6402.              StrCat, StrFix, StrLen, StrTrim
  6403.  
  6404.  
  6405.  
  6406.  
  6407.  
  6408.  
  6409.  
  6410.  
  6411.  
  6412.  
  6413.  
  6414.  
  6415.  
  6416.  
  6417.  
  6418.  
  6419.  
  6420.  
  6421.  
  6422.  
  6423.  
  6424.  
  6425.  
  6426.  
  6427.  
  6428.                                                                            113
  6429.  
  6430.                                                      CPML  FUNCTION  REFERENCE
  6431.  
  6432.  
  6433.  
  6434.           StrFix
  6435.           Pads or truncates a string to a fixed length.
  6436.  
  6437.           Syntax:
  6438.              StrFix (base-string, pad-string, length)
  6439.  
  6440.           Parameters:
  6441.              "base-string" =  string to be adjusted to a fixed length.
  6442.              "pad-string" = appended to "base-string" if needed to fill out
  6443.                        the desired length.  If "pad-string" is null, spaces
  6444.                        are used instead.
  6445.              "length" =  length of the desired string.
  6446.  
  6447.           Returns:
  6448.              (string)  fixed size string.
  6449.  
  6450.           This function "fixes" the length of a string, either by truncating
  6451.           it on the right, or by appending enough copies of pad-string to
  6452.           achieve the desired length.
  6453.  
  6454.  
  6455.           Example:
  6456.              a=StrFix("Henry"," ",15)
  6457.              b=StrFix("Betty"," ",15)
  6458.              c=StrFix("George"," ",15)
  6459.              Message("Spaced Names",strcat(a,b,c))
  6460.  
  6461.  
  6462.           See Also:
  6463.              StrFill, StrLen, StrTrim
  6464.  
  6465.  
  6466.  
  6467.  
  6468.  
  6469.  
  6470.  
  6471.  
  6472.  
  6473.  
  6474.  
  6475.  
  6476.  
  6477.  
  6478.  
  6479.  
  6480.  
  6481.  
  6482.  
  6483.  
  6484.                                                                            114
  6485.  
  6486.                                                      CPML  FUNCTION  REFERENCE
  6487.  
  6488.  
  6489.  
  6490.           StriCmp
  6491.           Compares two strings without regard to case.
  6492.  
  6493.           Syntax:
  6494.              StrICmp (string1, string2)
  6495.  
  6496.           Parameters:
  6497.              "string1", "string2" =strings to compare.
  6498.  
  6499.           Returns:
  6500.              (integer) -1, 0, or 1; depending on whether string1 is less than,
  6501.                        equal to, or greater than string2, respectively.
  6502.  
  6503.           Use this command to determine whether two strings are equal, or
  6504.           which precedes the other in an ACSII sorting sequence, when case is
  6505.           ignored.
  6506.  
  6507.  
  6508.           Example:
  6509.              a=AskLine("STRICMP","Enter a test line","")
  6510.              b=AskLine("STRICMP","Enter another test line","")
  6511.              c=stricmp(a,b)
  6512.              c=c+1
  6513.              d=strsub("less than   equal to    greater than",c*12,12)
  6514.              ;Note that above string is grouped into 12-character chunks.
  6515.              ;Desired chunk is removed with the strsub statement.
  6516.              message("STRICMP","%a% is %d% %b%")
  6517.  
  6518.  
  6519.           See Also:
  6520.              StrCmp, StrIndex, StrLen, StrScan, StrSub
  6521.  
  6522.  
  6523.  
  6524.  
  6525.  
  6526.  
  6527.  
  6528.  
  6529.  
  6530.  
  6531.  
  6532.  
  6533.  
  6534.  
  6535.  
  6536.  
  6537.  
  6538.  
  6539.  
  6540.                                                                            115
  6541.  
  6542.                                                      CPML  FUNCTION  REFERENCE
  6543.  
  6544.  
  6545.  
  6546.           StrIndex
  6547.           Searches a string for a substring.
  6548.  
  6549.           Syntax:
  6550.              StrIndex (string, sub-string, start, direction)
  6551.  
  6552.           Parameters:
  6553.              "string" =  the string to be searched for a substring.
  6554.              "substring" =  the string to look for within the main string.
  6555.              "start" = the position in the main string to begin the search.
  6556.                        The first character of a string is position 1.
  6557.              "direction" =  the search direction.  @FWDSCAN searches forward,
  6558.                        while @BACKSCAN searches backwards.
  6559.  
  6560.           Returns:
  6561.              (integer) position of "sub-string" within "string";
  6562.                        0 if not found.
  6563.  
  6564.           This function searches for a substring within a "target" string.
  6565.           Starting at the "start" position, it goes forward or backward
  6566.           depending on the value of the "direction" parameter.  It stops when
  6567.           it finds the "substring" within the "target" string, and returns
  6568.           its position.
  6569.  
  6570.           A start position of 0 has special meaning depending on which
  6571.           direction you are scanning.  For forward searches zero indicates
  6572.           the search should start at the beginning of the string.  For
  6573.           reverse searches zero causes it to start at the end of the string.
  6574.  
  6575.           Errors:
  6576.              3100 "StrIndex/StrScan 3rd parameter out of bounds"
  6577.  
  6578.           Example:
  6579.              Instr = AskLine ("STRINDEX", "Type a sentence:", "")
  6580.              start=1
  6581.              end=strindex(InStr," ",start,@FWDSCAN)
  6582.              terminate(end==0,"Sorry...","No spaces found")
  6583.              message("STRINDEX",strcat("The first word is: ",
  6584.                                  strsub(InStr,start,end-1))
  6585.              exit
  6586.  
  6587.  
  6588.           See Also:
  6589.              StrLen, StrScan, StrSub
  6590.  
  6591.  
  6592.  
  6593.  
  6594.  
  6595.  
  6596.                                                                            116
  6597.  
  6598.                                                      CPML  FUNCTION  REFERENCE
  6599.  
  6600.  
  6601.  
  6602.           StrLen
  6603.           Provides the length of a string.
  6604.  
  6605.           Syntax:
  6606.              StrLen (string)
  6607.  
  6608.           Parameters:
  6609.              "string" =  any text string.
  6610.  
  6611.           Returns:
  6612.              (integer) length of string.
  6613.  
  6614.           Use this command to determine the length of a string variable or
  6615.           expression.
  6616.  
  6617.  
  6618.           Example:
  6619.              MyFile=AskLine("Filename","File to process:","")
  6620.              FilenameLen=strlen(MyFile)
  6621.              Terminate(FilenameLen>13, "", "Filename too long!")
  6622.  
  6623.  
  6624.           See Also:
  6625.              StrFill, StrFix, StrIndex, StrScan, StrTrim
  6626.  
  6627.  
  6628.  
  6629.  
  6630.  
  6631.  
  6632.  
  6633.  
  6634.  
  6635.  
  6636.  
  6637.  
  6638.  
  6639.  
  6640.  
  6641.  
  6642.  
  6643.  
  6644.  
  6645.  
  6646.  
  6647.  
  6648.  
  6649.  
  6650.  
  6651.  
  6652.                                                                            117
  6653.  
  6654.                                                      CPML  FUNCTION  REFERENCE
  6655.  
  6656.  
  6657.  
  6658.           StrLower
  6659.           Converts a string to lowercase.
  6660.  
  6661.           Syntax:
  6662.              StrLower (string)
  6663.  
  6664.           Parameters:
  6665.              "string" =  any text string.
  6666.  
  6667.           Returns:
  6668.              (string)  lowercase string.
  6669.  
  6670.           Use this command to convert a text string to lower case.
  6671.  
  6672.  
  6673.           Example:
  6674.              a=AskLine("STRLOWER","Enter text","")
  6675.              b=strlower(a)
  6676.              message(a,b)
  6677.  
  6678.  
  6679.           See Also:
  6680.              StrICmp, StrUpper
  6681.  
  6682.  
  6683.  
  6684.  
  6685.  
  6686.  
  6687.  
  6688.  
  6689.  
  6690.  
  6691.  
  6692.  
  6693.  
  6694.  
  6695.  
  6696.  
  6697.  
  6698.  
  6699.  
  6700.  
  6701.  
  6702.  
  6703.  
  6704.  
  6705.  
  6706.  
  6707.  
  6708.                                                                            118
  6709.  
  6710.                                                      CPML  FUNCTION  REFERENCE
  6711.  
  6712.  
  6713.  
  6714.           StrScan
  6715.           Searches string for occurrence of delimiters.
  6716.  
  6717.           Syntax:
  6718.              StrScan (string, delimiters, start, direction)
  6719.  
  6720.           Parameters:
  6721.              "string" =  the string that is to be searched.
  6722.              "delimiters" = a string of delimiters to search for within
  6723.                        "string".
  6724.              "start" = the position in the main string to begin the search.
  6725.                        The first character of a string is  position 1.
  6726.              "direction" =  the search direction.  @FWDSCAN searches forward,
  6727.                        while @BACKSCAN searches backwards.
  6728.  
  6729.           Returns:
  6730.              (integer) position of delimiter in string, or 0 if not found.
  6731.  
  6732.           This function searches for delimiters within a target "string".
  6733.           Starting at the "start" position, it goes forward or backward
  6734.           depending on the value of the "direction" parameter.  It stops when
  6735.           it finds any one of the characters in the "delimiters" string
  6736.           within the target "string".
  6737.  
  6738.  
  6739.           Errors:
  6740.              3100 "StrIndex/StrScan 3rd parameter out of bounds"
  6741.  
  6742.           Example:
  6743.              TheStr="123,456.789:abc"
  6744.              start=1
  6745.              end=strscan(TheStr,",.:",start,@FWDSCAN)
  6746.              terminate(end==0,"Sorry...","No delimiters found")
  6747.              message("The first parameter",strsub(
  6748.                                  TheStr,start,end-start+1))
  6749.              exit
  6750.  
  6751.  
  6752.           See Also:
  6753.              StrLen, StrSub
  6754.  
  6755.  
  6756.  
  6757.  
  6758.  
  6759.  
  6760.  
  6761.  
  6762.  
  6763.  
  6764.                                                                            119
  6765.  
  6766.                                                      CPML  FUNCTION  REFERENCE
  6767.  
  6768.  
  6769.  
  6770.           StrSub
  6771.           Extracts a substring out of an existing string.
  6772.  
  6773.           Syntax:
  6774.              StrSub (string, start, length)
  6775.  
  6776.           Parameters:
  6777.              "string" =  the string from which the substring is to be
  6778.                        extracted.
  6779.              "start" = character position within "string" where the sub-string
  6780.                        starts.  (The first character of the string is at
  6781.                        position 1).
  6782.              "length" =  length of desired substring.  If you specify a
  6783.                        length of zero it will return a null string.
  6784.  
  6785.           Returns:
  6786.              (string)  substring of parameter string.
  6787.  
  6788.           This function extracts a substring from within a "target" string.
  6789.           Starting at the "start" position, it copies up to "length"
  6790.           characters into the substring.
  6791.  
  6792.  
  6793.           Errors:
  6794.              3059 "Illegal Bounds for STRSUB function"
  6795.  
  6796.           Example:
  6797.              a="My dog has fleas"
  6798.              animal=strsub(a,4,3)
  6799.              Message("STRSUB","My animal is a %animal%")
  6800.  
  6801.  
  6802.           See Also:
  6803.              StrLen, StrScan
  6804.  
  6805.  
  6806.  
  6807.  
  6808.  
  6809.  
  6810.  
  6811.  
  6812.  
  6813.  
  6814.  
  6815.  
  6816.  
  6817.  
  6818.  
  6819.  
  6820.                                                                            120
  6821.  
  6822.                                                      CPML  FUNCTION  REFERENCE
  6823.  
  6824.  
  6825.  
  6826.           StrTrim
  6827.           Removes leading and trailing spaces from a character string.
  6828.  
  6829.           Syntax:
  6830.              StrTrim (string)
  6831.  
  6832.           Parameters:
  6833.              "string" =  a string with unwanted spaces at the beginning
  6834.                        and/or the end.
  6835.  
  6836.           Returns:
  6837.              (string)  string devoid of leading and trailing spaces.
  6838.  
  6839.           Use this function to remove unwanted spaces from the beginning and
  6840.           end of text data.
  6841.  
  6842.  
  6843.           Example:
  6844.              TheFile = AskLine("STRTRIM","Filename ('exit' cancels)","")
  6845.              TstExit = strtrim(strlower(TheFile))
  6846.              Terminate(TstExit=="exit","Cancelled","...by user request")
  6847.              ;processing of TheFile continues...
  6848.  
  6849.  
  6850.           See Also:
  6851.              StrFill, StrFix, StrLen
  6852.  
  6853.  
  6854.  
  6855.  
  6856.  
  6857.  
  6858.  
  6859.  
  6860.  
  6861.  
  6862.  
  6863.  
  6864.  
  6865.  
  6866.  
  6867.  
  6868.  
  6869.  
  6870.  
  6871.  
  6872.  
  6873.  
  6874.  
  6875.  
  6876.                                                                            121
  6877.  
  6878.                                                      CPML  FUNCTION  REFERENCE
  6879.  
  6880.  
  6881.  
  6882.           StrUpper
  6883.           Converts a string to uppercase.
  6884.  
  6885.           Syntax:
  6886.              StrUpper (string)
  6887.  
  6888.           Parameters:
  6889.              "string" =  any text string.
  6890.  
  6891.           Returns:
  6892.              (string)  uppercase string.
  6893.  
  6894.           Use this function to convert a text string to upper case.
  6895.  
  6896.  
  6897.           Example:
  6898.              a=AskLine("STRUPPER","Enter text","")
  6899.              b=strupper(a)
  6900.              message(a,b)
  6901.  
  6902.  
  6903.           See Also:
  6904.              StrICmp, StrLower
  6905.  
  6906.  
  6907.  
  6908.  
  6909.  
  6910.  
  6911.  
  6912.  
  6913.  
  6914.  
  6915.  
  6916.  
  6917.  
  6918.  
  6919.  
  6920.  
  6921.  
  6922.  
  6923.  
  6924.  
  6925.  
  6926.  
  6927.  
  6928.  
  6929.  
  6930.  
  6931.  
  6932.                                                                            122
  6933.  
  6934.                                                      CPML  FUNCTION  REFERENCE
  6935.  
  6936.  
  6937.  
  6938.           Terminate
  6939.           Conditionally ends the menuitem.
  6940.  
  6941.           Syntax:
  6942.              Terminate (expression, title, message)
  6943.  
  6944.           Parameters:
  6945.              "expression" = any logical expression.
  6946.              "title" = the title of a message box to be displayed before
  6947.                        termination.
  6948.              "message" = the message in the message box.
  6949.  
  6950.           Returns:
  6951.              (integer) always @TRUE.
  6952.  
  6953.           This command ends processing for the menu item if "expression" is
  6954.           nonzero.  Note that many functions return @TRUE (1) or @FALSE (0),
  6955.           which you can use to decide whether to cancel a menu item.
  6956.  
  6957.           If either "title" or "message" contains a string, a message box
  6958.           with a title and a message is displayed before exiting.
  6959.  
  6960.           Examples:
  6961.              ;Unconditional Termination w/o message box.
  6962.              ;Same as "Exit":
  6963.              Terminate(@TRUE,"","")
  6964.  
  6965.              ;Basically a no-op:
  6966.              Terminate(@FALSE,"","This will never terminate")
  6967.  
  6968.              ;Exits with message if a is less than zero:
  6969.              Terminate(a<0,"Error","Cannot use negative numbers")
  6970.  
  6971.  
  6972.  
  6973.  
  6974.  
  6975.  
  6976.  
  6977.  
  6978.              ;Exits w/o message if answer isn't "YES":
  6979.              Terminate(answer!="YES","","")
  6980.  
  6981.  
  6982.           See Also:
  6983.              Display, Pause, Message
  6984.  
  6985.  
  6986.  
  6987.  
  6988.                                                                            123
  6989.  
  6990.                                                      CPML  FUNCTION  REFERENCE
  6991.  
  6992.           TextBox
  6993.           Displays a file in a listbox on the screen and returns selected
  6994.           line, if any.
  6995.  
  6996.           Syntax:
  6997.              TextBox (title, filename)
  6998.  
  6999.           Parameters:
  7000.              "title" = listbox title.
  7001.              "filename" =file containing contents of listbox.
  7002.  
  7003.           Returns:
  7004.              (string) =  highlighted string, if any.
  7005.  
  7006.           The TextBox command loads a file into a Windows listbox and
  7007.           displays the listbox to the user.  The command has two primary
  7008.           uses:  First off, it can be used to display multi-line messages to
  7009.           the user.  In addition, because of its ability to return a selected
  7010.           line, it may be used as a multiple choice question box.  The line
  7011.           highlighted by the user (if any) will be returned to the program.
  7012.  
  7013.           If disk drive and path not are part of the filename,  the current
  7014.           directory will be examined first, and then the DOS path will be
  7015.           searched to find the desired file.
  7016.  
  7017.           Example:
  7018.              ;Display config.sys:
  7019.              a=TextBox("Choose a line","C:\CONFIG.SYS")
  7020.              display(3,"Chosen line",a)
  7021.  
  7022.  
  7023.  
  7024.  
  7025.  
  7026.  
  7027.  
  7028.  
  7029.  
  7030.  
  7031.  
  7032.  
  7033.  
  7034.  
  7035.  
  7036.  
  7037.  
  7038.  
  7039.  
  7040.  
  7041.           See Also:
  7042.              ItemSelect
  7043.  
  7044.                                                                            124
  7045.  
  7046.                                                      CPML  FUNCTION  REFERENCE
  7047.  
  7048.           Version
  7049.           Returns the version number of the currently-running Command Post
  7050.           language processor.
  7051.  
  7052.           Syntax:
  7053.              Version ( )
  7054.  
  7055.           Returns:
  7056.              (string) =  Command Post version number.
  7057.  
  7058.           Use this function to determine the version of Command Post that is
  7059.           running.  It is useful to verify that a menu generated with the
  7060.           latest version of the language will operate properly on what may be
  7061.           a different machine with a different version of Command Post
  7062.           installed.
  7063.  
  7064.  
  7065.           Example:
  7066.              a=Version()
  7067.  
  7068.  
  7069.           See Also:
  7070.              Environment, WinVersion
  7071.  
  7072.  
  7073.  
  7074.  
  7075.  
  7076.  
  7077.  
  7078.  
  7079.  
  7080.  
  7081.  
  7082.  
  7083.  
  7084.  
  7085.  
  7086.  
  7087.  
  7088.  
  7089.  
  7090.  
  7091.  
  7092.  
  7093.  
  7094.  
  7095.  
  7096.  
  7097.  
  7098.  
  7099.  
  7100.                                                                            125
  7101.  
  7102.                                                      CPML  FUNCTION  REFERENCE
  7103.  
  7104.  
  7105.  
  7106.           WinActivate
  7107.           Activates a previously running window.
  7108.  
  7109.           Syntax:
  7110.              WinActivate (partial-windowname)
  7111.  
  7112.           Parameters:
  7113.              "partial-windowname" =
  7114.                        either an initial portion of, or an entire window name.
  7115.                        The most-recently used window whose title matches the
  7116.                        name will be activated.
  7117.  
  7118.           Returns:
  7119.              (integer) @TRUE if a window was found to activate;
  7120.                        @FALSE if no windows were found.
  7121.  
  7122.           Use this command to activate windows for user input.
  7123.  
  7124.  
  7125.           Errors:
  7126.              1045 "WinActivate: Window not found"
  7127.  
  7128.           Example:
  7129.              Run("notepad.exe","")
  7130.              Run("clock.exe","")
  7131.              WinActivate("Notepad")
  7132.  
  7133.  
  7134.           See Also:
  7135.              WinCloseNot, WinGetActive, WinShow
  7136.  
  7137.  
  7138.  
  7139.  
  7140.  
  7141.  
  7142.  
  7143.  
  7144.  
  7145.  
  7146.  
  7147.  
  7148.  
  7149.  
  7150.  
  7151.  
  7152.  
  7153.  
  7154.  
  7155.  
  7156.                                                                            126
  7157.  
  7158.                                                      CPML  FUNCTION  REFERENCE
  7159.  
  7160.  
  7161.  
  7162.           WinArrange
  7163.           Arranges, tiles, and/or stacks application windows.
  7164.  
  7165.           Syntax:
  7166.              WinArrange (style)
  7167.  
  7168.           Parameters:
  7169.              style =   one of the following:  @STACK, @TILE (or @ARRANGE),
  7170.                        @ROWS, or @COLUMNS.
  7171.  
  7172.           Returns:
  7173.              (integer) always @TRUE.
  7174.  
  7175.           Use this command to rearrange the open windows on the screen.  (Any
  7176.           iconized programs are unaffected.)
  7177.  
  7178.  
  7179.  
  7180.  
  7181.  
  7182.  
  7183.  
  7184.  
  7185.  
  7186.  
  7187.  
  7188.                                 @STACKED          @TILED
  7189.  
  7190.  
  7191.  
  7192.  
  7193.  
  7194.  
  7195.  
  7196.  
  7197.  
  7198.  
  7199.                                 @ROWS          @COLUMNS
  7200.  
  7201.           When you specify @ROWS and you have more than four open windows, or
  7202.           if you specify @COLUMNS and you have more than three open windows,
  7203.           Command Post will revert to @TILE.
  7204.  
  7205.  
  7206.           See Also:
  7207.              WinItemize, WinHide, WinIconize, WinPlace, WinShow, WinZoom
  7208.  
  7209.  
  7210.  
  7211.  
  7212.                                                                            127
  7213.  
  7214.                                                      CPML  FUNCTION  REFERENCE
  7215.  
  7216.           WinClose
  7217.           Closes an open window.
  7218.  
  7219.           Syntax:
  7220.              WinClose (partial-windowname)
  7221.  
  7222.           Parameters:
  7223.              "partial-windowname" =
  7224.                        either an initial portion of, or an entire window name.
  7225.                        The most-recently used window whose title matches the
  7226.                        name will be closed.
  7227.  
  7228.           Returns:
  7229.              (integer) @TRUE if a window was found to close;
  7230.                        @FALSE if no windows were found.
  7231.  
  7232.           Use this command to close windows.
  7233.  
  7234.           This command will not close the current Command Post window.  You
  7235.           can, however, call EndSession to end the current Windows session.
  7236.  
  7237.           Errors:
  7238.              1039 "WinClose: Window not found"
  7239.  
  7240.           Example:
  7241.              Run ("notepad.exe","")
  7242.              WinClose("Notepad")
  7243.  
  7244.  
  7245.           See Also:
  7246.              WinCloseNot, WinHide, WinIconize, WinWaitClose
  7247.  
  7248.  
  7249.  
  7250.  
  7251.  
  7252.  
  7253.  
  7254.  
  7255.  
  7256.  
  7257.  
  7258.  
  7259.  
  7260.  
  7261.  
  7262.  
  7263.  
  7264.  
  7265.  
  7266.  
  7267.  
  7268.                                                                            128
  7269.  
  7270.                                                      CPML  FUNCTION  REFERENCE
  7271.  
  7272.  
  7273.  
  7274.           WinCloseNot
  7275.           Closes all windows, except those provided as parameters:.
  7276.  
  7277.           Syntax:
  7278.              WinCloseNot (partial-windowname [, partial-windowname]...)
  7279.  
  7280.           Parameters:
  7281.              partial-windowname =
  7282.                        either an initial portion of, or an entire window name.
  7283.                        Any windows whose titles match the partial names will
  7284.                        stay open.
  7285.  
  7286.           Returns:
  7287.              (integer) always @TRUE.
  7288.  
  7289.           Use this command to close all windows except those specifically
  7290.           listed in the parameter strings.
  7291.  
  7292.           At least one partial windowname must be given.  A null-string
  7293.           parameter would match all windows, or in other words close nothing.
  7294.  
  7295.           Errors:
  7296.              2038 "WinCloseNot Function Syntax error"
  7297.  
  7298.           Example:
  7299.              ;The statement below will close all windows except:
  7300.              ;1) MS-DOS Executive (starts with 'MS-D')
  7301.              ;2) Clock  (starts with 'Clo' )
  7302.  
  7303.              WinCloseNot("MS-D","Clo")
  7304.  
  7305.  
  7306.           See Also:
  7307.              WinItemize, WinClose, WinHide, WinIconize, WinWaitClose
  7308.  
  7309.  
  7310.  
  7311.  
  7312.  
  7313.  
  7314.  
  7315.  
  7316.  
  7317.  
  7318.  
  7319.  
  7320.  
  7321.  
  7322.  
  7323.  
  7324.                                                                            129
  7325.  
  7326.                                                      CPML  FUNCTION  REFERENCE
  7327.  
  7328.  
  7329.  
  7330.           WinGetActive
  7331.           Gets the title of the active window.
  7332.  
  7333.           Syntax:
  7334.              WinGetActive ( )
  7335.  
  7336.           Returns:
  7337.              (string)  title of active window.
  7338.  
  7339.           Use this command to determine which window is currently active.
  7340.  
  7341.  
  7342.           Example:
  7343.              CurrentWin=WinGetActive()
  7344.  
  7345.  
  7346.           See Also:
  7347.              WinItemize, WinActivate
  7348.  
  7349.  
  7350.  
  7351.  
  7352.  
  7353.  
  7354.  
  7355.  
  7356.  
  7357.  
  7358.  
  7359.  
  7360.  
  7361.  
  7362.  
  7363.  
  7364.  
  7365.  
  7366.  
  7367.  
  7368.  
  7369.  
  7370.  
  7371.  
  7372.  
  7373.  
  7374.  
  7375.  
  7376.  
  7377.  
  7378.  
  7379.  
  7380.                                                                            130
  7381.  
  7382.                                                      CPML  FUNCTION  REFERENCE
  7383.  
  7384.  
  7385.  
  7386.           WinHide
  7387.           Hides a window.
  7388.  
  7389.           Syntax:
  7390.              WinHide (partial-windowname)
  7391.  
  7392.           Parameters:
  7393.              "partial-windowname" =
  7394.                        either an initial portion of, or an entire window name.
  7395.                        The most-recently used window whose title matches the
  7396.                        name will be hidden.
  7397.  
  7398.           Returns:
  7399.              (integer) @TRUE if a window was found to hide;
  7400.                        @FALSE if no windows were found.
  7401.  
  7402.           Use this command to hide windows.  The programs are still running
  7403.           when they are hidden.
  7404.  
  7405.           A partial-windowname of "" hides the current Command Post window.
  7406.  
  7407.           Errors:
  7408.              1040 "WinHide: Window not found"
  7409.  
  7410.           Example:
  7411.              Run("notepad.exe","")
  7412.              WinHide("Notepad")
  7413.              WinShow("Notepad")
  7414.  
  7415.  
  7416.           See Also:
  7417.              WinClose, WinIconize, WinPlace
  7418.  
  7419.  
  7420.  
  7421.  
  7422.  
  7423.  
  7424.  
  7425.  
  7426.  
  7427.  
  7428.  
  7429.  
  7430.  
  7431.  
  7432.  
  7433.  
  7434.  
  7435.  
  7436.                                                                            131
  7437.  
  7438.                                                      CPML  FUNCTION  REFERENCE
  7439.  
  7440.  
  7441.  
  7442.           WinIconize
  7443.           Iconizes a window.
  7444.  
  7445.           Syntax:
  7446.              WinIconize (partial-windowname)
  7447.  
  7448.           Parameters:
  7449.              "partial-windowname" =
  7450.                        either an initial portion of, or an entire window name.
  7451.                        The most-recently used window whose title matches the
  7452.                        name will be iconized.
  7453.  
  7454.           Returns:
  7455.              (integer) @TRUE if a window was found to iconize;
  7456.                        @FALSE if no windows were found.
  7457.  
  7458.           Use this command to turn a window into an icon at the bottom of the
  7459.           screen.
  7460.  
  7461.           A partial-windowname of "" iconizes the current Command Post
  7462.           window.
  7463.  
  7464.           Errors:
  7465.              1041 "WinIconize: Window not found"
  7466.  
  7467.           Example:
  7468.              Run("clock.exe","")
  7469.              WinIconize("Clo") ; partial window name used here
  7470.  
  7471.  
  7472.           See Also:
  7473.              WinClose, WinHide, WinPlace, WinShow, WinZoom
  7474.  
  7475.  
  7476.  
  7477.  
  7478.  
  7479.  
  7480.  
  7481.  
  7482.  
  7483.  
  7484.  
  7485.  
  7486.  
  7487.  
  7488.  
  7489.  
  7490.  
  7491.  
  7492.                                                                            132
  7493.  
  7494.                                                      CPML  FUNCTION  REFERENCE
  7495.  
  7496.  
  7497.  
  7498.           WinItemize
  7499.           Returns a tab-delimited list of all open windows.
  7500.  
  7501.           Syntax:
  7502.              WinItemize ( )
  7503.  
  7504.           Returns:
  7505.              (string)  list of all open windows' titles.
  7506.  
  7507.           This function compiles a list of all the open application windows'
  7508.           titles and separates the titles by tabs.  This is especially useful
  7509.           in conjunction with the ItemSelect function, which enables the user
  7510.           to choose an item from such a tab-delimited list.
  7511.  
  7512.           Note this behaves somewhat differently than FileItemize and
  7513.           DirItemize, which create space-delimited lists.  This is because
  7514.           window titles regularly contain embedded spaces.
  7515.  
  7516.           Example:
  7517.           &Windows
  7518.            &Find a window
  7519.              AllWins = WinItemize()
  7520.              HTab = Num2Char(9)
  7521.              MyWind = ItemSelect("Windows",AllWins, HTab)
  7522.              WinActivate(MyWind)
  7523.  
  7524.  
  7525.           See Also:
  7526.              DirItemize, FileItemize, ItemSelect
  7527.  
  7528.  
  7529.  
  7530.  
  7531.  
  7532.  
  7533.  
  7534.  
  7535.  
  7536.  
  7537.  
  7538.  
  7539.  
  7540.  
  7541.  
  7542.  
  7543.  
  7544.  
  7545.  
  7546.  
  7547.  
  7548.                                                                            133
  7549.  
  7550.                                                      CPML  FUNCTION  REFERENCE
  7551.  
  7552.  
  7553.  
  7554.           WinPlace
  7555.           Places a window anywhere on the screen.
  7556.  
  7557.           Syntax:
  7558.              WinPlace (x-ulc, y-ulc, x-brc, y-brc, partial-windowname)
  7559.  
  7560.           Parameters:
  7561.              x-ulc =   how far from the left of the screen to place the upper-
  7562.                        left corner (0-1000).
  7563.              y-ulc =   how far from the top of the screen to place the upper-
  7564.                        left corner (0-1000).
  7565.              x-brc =   how far from the left of the screen to place the
  7566.                        bottom-right corner (10-1000) or @NORESIZE.
  7567.              y-brc =   how far from the top of the screen to place the bottom-
  7568.                        right corner (10-1000) or @NORESIZE or @ABOVEICONS.
  7569.              "partial-windowname" =
  7570.                        either an initial portion of, or an entire window name.
  7571.                        The most-recently used window whose title matches the
  7572.                        name will be moved to the new position.
  7573.  
  7574.           Returns:
  7575.              (integer) @TRUE if a window was found to move;
  7576.                        @FALSE if no windows were found.
  7577.  
  7578.           Use this command to move windows on the screen.  (You cannot,
  7579.           however, move icons or windows that have been maximized to full
  7580.           screen.)  A partial-windowname of "" moves the current Command Post
  7581.           window.
  7582.  
  7583.           The "x-ulc", "y-ulc", "x-brc", and "y-brc" parameters are based on
  7584.           a logical screen that is 1000 points wide by 1000 points high.
  7585.           You can move the window without changing the width and/or height by
  7586.           specifying @NORESIZE for the "x-brc" and/or "y-brc" parameters,
  7587.           respectively.
  7588.  
  7589.           You can fix the bottom of the window to sit just above the line of
  7590.           icons along the bottom of the screen by specifying a "y-brc" of
  7591.           @ABOVEICONS.
  7592.           Some sample parameters:
  7593.              Upper left quarter of the screen:  0, 0, 500, 500
  7594.              Upper right quarter:  500, 0, 500, 1000
  7595.              Center quarter:  250, 250, 750, 750
  7596.              Lower left eighth:  0, 750, 500, 1000
  7597.  
  7598.  
  7599.  
  7600.  
  7601.  
  7602.  
  7603.  
  7604.                                                                            134
  7605.  
  7606.                                                      CPML  FUNCTION  REFERENCE
  7607.  
  7608.           A handy utility program is included with Command Post, called
  7609.           WinInfo.exe.  This program lets you take an open window that is
  7610.           sized and positioned the way you like it, and automatically create
  7611.           the proper WinPlace statement for you.  It puts the text into the
  7612.           Clipboard, from which you can paste it into your menu code:
  7613.  
  7614.  
  7615.  
  7616.  
  7617.  
  7618.  
  7619.  
  7620.  
  7621.  
  7622.  
  7623.  
  7624.  
  7625.  
  7626.  
  7627.           You'll need a mouse to use WinInfo.  While WinInfo is the active
  7628.           window, place the mouse over the window you wish to create the
  7629.           WinPlace statement for, and press the spacebar.  The new statement
  7630.           will be placed into the Clipboard.  Then press the Esc key to close
  7631.           WinInfo.
  7632.  
  7633.           Errors:
  7634.              1044 "WinPlace: Window not found"
  7635.  
  7636.           Example:
  7637.              WinPlace(0,0,200,200,"Clock")
  7638.  
  7639.  
  7640.           See Also:
  7641.              WinArrange, WinHide, WinIconize, WinShow, WinZoom
  7642.  
  7643.  
  7644.  
  7645.  
  7646.  
  7647.  
  7648.  
  7649.  
  7650.  
  7651.  
  7652.  
  7653.  
  7654.  
  7655.  
  7656.  
  7657.  
  7658.  
  7659.  
  7660.                                                                            135
  7661.  
  7662.                                                      CPML  FUNCTION  REFERENCE
  7663.  
  7664.  
  7665.  
  7666.           WinShow
  7667.           Shows a window in its "normal" state.
  7668.  
  7669.           Syntax:
  7670.              WinShow (partial-windowname)
  7671.  
  7672.           Parameters:
  7673.              "partial-windowname" =
  7674.                        either an initial portion of, or an entire window name.
  7675.                        The most-recently used window whose title matches the
  7676.                        name will be shown.
  7677.  
  7678.           Returns:
  7679.              (integer) @TRUE if a window was found to show;
  7680.                        @FALSE if no windows were found.
  7681.  
  7682.           Use this command to restore a window to its "normal" size and
  7683.           position.
  7684.  
  7685.           A partial-windowname of "" restores the current Command Post
  7686.           window.
  7687.  
  7688.           Errors:
  7689.              1043 "WinShow: Window not found"
  7690.  
  7691.           Example:
  7692.              RunZoom("notepad.exe","")
  7693.              ;other processing...
  7694.              WinShow("Notepad")
  7695.  
  7696.  
  7697.           See Also:
  7698.              WinArrange, WinHide, WinIconize, WinZoom
  7699.  
  7700.  
  7701.  
  7702.  
  7703.  
  7704.  
  7705.  
  7706.  
  7707.  
  7708.  
  7709.  
  7710.  
  7711.  
  7712.  
  7713.  
  7714.  
  7715.  
  7716.                                                                            136
  7717.  
  7718.                                                      CPML  FUNCTION  REFERENCE
  7719.  
  7720.  
  7721.  
  7722.           WinTitle
  7723.           Changes the title of a window.
  7724.  
  7725.           Syntax:
  7726.              WinTitle (partial-windowname, new-name)
  7727.  
  7728.           Parameters:
  7729.              "partial-windowname" =
  7730.                        either an initial portion of, or an entire window name.
  7731.                        The most-recently used window whose title matches the
  7732.                        name will be shown.
  7733.              "new-name" =the new name of the window.
  7734.  
  7735.           Returns:
  7736.              (integer) @TRUE if a window was found to rename;
  7737.                        @FALSE if no windows were found.
  7738.  
  7739.           Use this command to change a window's title.
  7740.  
  7741.           A partial-windowname of "" refers to the current Command Post
  7742.           window.
  7743.           Note:  Some applications may rely upon their window's title staying
  7744.           the same!  It should be used with caution and adequate testing.
  7745.  
  7746.  
  7747.           Example:
  7748.           &Windows (special)
  7749.            Make &Uppercase
  7750.              HTab = Num2Char(9)
  7751.              AllWinds = WinItemize()
  7752.              MyWin=ItemSelect("Uppercase Windows", AllWinds, HTab)
  7753.              WinTitle(MyWin, StrUpper(MyWin))
  7754.              Drop (HTab, AllWinds, MyWin)
  7755.  
  7756.  
  7757.           See Also:
  7758.              WinItemize
  7759.  
  7760.  
  7761.  
  7762.  
  7763.  
  7764.  
  7765.  
  7766.  
  7767.  
  7768.  
  7769.  
  7770.  
  7771.  
  7772.                                                                            137
  7773.  
  7774.                                                      CPML  FUNCTION  REFERENCE
  7775.  
  7776.  
  7777.  
  7778.           WinVersion
  7779.           Provides the version number of the current Windows system.
  7780.  
  7781.           Syntax:
  7782.              WinVersion (level)
  7783.  
  7784.           Parameters:
  7785.              "level" = either @MAJOR or @MINOR.
  7786.  
  7787.           Returns:
  7788.              (integer) either major or minor part of the Windows version
  7789.                        number.
  7790.  
  7791.           Use this command to determine which version of Windows is currently
  7792.           running.
  7793.  
  7794.           @MAJOR returns the integer part of the Windows version number; i.e.
  7795.           1.0, 2.11, 3.0, etc.
  7796.           @MINOR returns the decimal part of the Windows version number; i.e.
  7797.           1.0, 2.11, 3.0, etc.
  7798.  
  7799.  
  7800.           Example:
  7801.           &Info
  7802.            Windows &Version
  7803.              MinorVer=WinVersion(@MINOR)
  7804.              MajorVer=WinVersion(@MAJOR)
  7805.              Message("Windows Version",strcat(MajorVer,".",MinorVer))
  7806.  
  7807.  
  7808.           See Also:
  7809.              Version
  7810.  
  7811.  
  7812.  
  7813.  
  7814.  
  7815.  
  7816.  
  7817.  
  7818.  
  7819.  
  7820.  
  7821.  
  7822.  
  7823.  
  7824.  
  7825.  
  7826.  
  7827.  
  7828.                                                                            138
  7829.  
  7830.                                                      CPML  FUNCTION  REFERENCE
  7831.  
  7832.  
  7833.  
  7834.           WinWaitClose
  7835.           Suspends the menu execution until a specified window has been
  7836.           closed.
  7837.  
  7838.           Syntax:
  7839.              WinWaitClose (partial-windowname)
  7840.  
  7841.           Parameters:
  7842.              "partial-windowname" =
  7843.                        either an initial portion of, or an entire window name.
  7844.                        WinWaitClose suspends execution until all matching
  7845.                        windows have been closed.
  7846.  
  7847.           Returns:
  7848.              (integer) @TRUE if at least one window was found to wait for;
  7849.                        @FALSE if no windows were found.
  7850.  
  7851.           Use this command to suspend the menu item's execution until the
  7852.           user has finished using a given window and has manually closed it.
  7853.  
  7854.  
  7855.           Example:
  7856.              ;WinWaitClose command example
  7857.              run("clock.exe","")
  7858.              Display(4,"Note","Close Clock to continue")
  7859.              WinWaitClose("Clock")
  7860.              Message("Continuing...","Clock closed")
  7861.  
  7862.  
  7863.           See Also:
  7864.              Delay, Yield
  7865.  
  7866.  
  7867.  
  7868.  
  7869.  
  7870.  
  7871.  
  7872.  
  7873.  
  7874.  
  7875.  
  7876.  
  7877.  
  7878.  
  7879.  
  7880.  
  7881.  
  7882.  
  7883.  
  7884.                                                                            139
  7885.  
  7886.                                                      CPML  FUNCTION  REFERENCE
  7887.  
  7888.  
  7889.  
  7890.           WinZoom
  7891.           Maximizes a window to full-screen.
  7892.  
  7893.           Syntax:
  7894.              WinZoom (partial-windowname)
  7895.  
  7896.           Parameters:
  7897.              "partial-windowname" =
  7898.                        either an initial portion of, or an entire window name.
  7899.                        The most-recently used window whose title matches the
  7900.                        name will be shown.
  7901.  
  7902.           Returns:
  7903.              (integer) @TRUE if a window was found to zoom;
  7904.                        @FALSE if no windows were found.
  7905.  
  7906.           Use this command to "zoom" windows to full screen size.
  7907.  
  7908.           A partial-windowname of "" zooms the current Command Post window.
  7909.  
  7910.           Errors:
  7911.              1042 "WinZoom: Window not found"
  7912.  
  7913.           Example:
  7914.              Run("notepad.exe","")
  7915.              WinZoom("Notepad")
  7916.              WinShow("Notepad")
  7917.  
  7918.  
  7919.           See Also:
  7920.              WinHide, WinIconize, WinPlace, WinShow
  7921.  
  7922.  
  7923.  
  7924.  
  7925.  
  7926.  
  7927.  
  7928.  
  7929.  
  7930.  
  7931.  
  7932.  
  7933.  
  7934.  
  7935.  
  7936.  
  7937.  
  7938.  
  7939.  
  7940.                                                                            140
  7941.  
  7942.                                                      CPML  FUNCTION  REFERENCE
  7943.  
  7944.  
  7945.  
  7946.           Yield
  7947.           Provides time for other windows to do processing.
  7948.  
  7949.           Syntax:
  7950.              Yield
  7951.  
  7952.           Returns:
  7953.              nothing.
  7954.  
  7955.           Use this command to give other running windows time to process.
  7956.           This command will allow each open window to process 20 or more
  7957.           messages.
  7958.  
  7959.  
  7960.           Example:
  7961.              ;run PageMaker and give it some time to start up...
  7962.              PMFile = AskLine ("PageMaker", "File to run:", "")
  7963.              run("PM.EXE", PMFile)
  7964.              yield
  7965.              yield
  7966.              yield
  7967.  
  7968.  
  7969.           See Also:
  7970.              Delay
  7971.  
  7972.  
  7973.  
  7974.  
  7975.  
  7976.  
  7977.  
  7978.  
  7979.  
  7980.  
  7981.  
  7982.  
  7983.  
  7984.  
  7985.  
  7986.  
  7987.  
  7988.  
  7989.  
  7990.  
  7991.  
  7992.  
  7993.  
  7994.  
  7995.  
  7996.                                                                            141
  7997.  
  7998.                                                          APPENDIX A    Browser
  7999.  
  8000.  
  8001.                                        APPENDIX A
  8002.  
  8003.                                         Browser
  8004.  
  8005.           The Command Post Browser program lets you view a file's contents in
  8006.           a variety of ways.
  8007.  
  8008.           The default is to show the file in Windows' "ANSI text" mode:
  8009.  
  8010.  
  8011.  
  8012.  
  8013.  
  8014.  
  8015.  
  8016.  
  8017.  
  8018.  
  8019.  
  8020.  
  8021.  
  8022.           Initial Browser View - ANSI Text
  8023.  
  8024.           As you can see, Browser gives you five main menus to choose from:
  8025.  
  8026.           File
  8027.           These menu items let you open a new file to view, re-read the
  8028.           current file, and perform other housekeeping functions including
  8029.           exiting the program.
  8030.  
  8031.  
  8032.           Hide & Seek
  8033.           Browser gives you the ability to filter which lines you view with
  8034.           its Hide & Seek commands.  You can hide or show specific lines by
  8035.           entering a word to look for.
  8036.           For instance, the menu item Hide & Seek/Show if... displays this
  8037.           dialog box:
  8038.  
  8039.  
  8040.  
  8041.  
  8042.  
  8043.  
  8044.  
  8045.  
  8046.  
  8047.           ...and (in this example) shows only the lines containing the word
  8048.           "modem":
  8049.  
  8050.  
  8051.  
  8052.                                                                            142
  8053.  
  8054.                                                          APPENDIX A    Browser
  8055.  
  8056.  
  8057.  
  8058.  
  8059.  
  8060.  
  8061.  
  8062.  
  8063.  
  8064.  
  8065.  
  8066.  
  8067.  
  8068.  
  8069.  
  8070.           Print   *** Not currently available---We're working on it***
  8071.           These selections allow you to print all or part of the file.
  8072.  
  8073.           Clip Copy
  8074.           Lets you copy portions of the file into the Windows Clipboard.
  8075.  
  8076.  
  8077.           Clip Append
  8078.           Lets you add portions of the file onto the end of the Windows
  8079.           Clipboard.
  8080.  
  8081.           Options
  8082.           These menu items let you change how you view the file; changing for
  8083.           example between ASCII text mode (which interprets some special
  8084.           characters differently than ANSI text) and hex-dump formats:
  8085.  
  8086.  
  8087.  
  8088.  
  8089.  
  8090.  
  8091.  
  8092.  
  8093.  
  8094.  
  8095.                       Options/ASCII text          Options/Hex dump
  8096.  
  8097.  
  8098.  
  8099.  
  8100.  
  8101.  
  8102.  
  8103.  
  8104.  
  8105.  
  8106.  
  8107.  
  8108.                                                                            143
  8109.  
  8110.                                    APPENDIX B    Command Post  and Windows 3.0
  8111.  
  8112.  
  8113.                                        APPENDIX B
  8114.  
  8115.                                       Command Post
  8116.                                     and Windows 3.0
  8117.  
  8118.  
  8119.  
  8120.           Command Post as Your Shell
  8121.           Normally, Command Post is automatically launched along with the
  8122.           Program Manager, since it is included on the "Run=" line of the
  8123.           WIN.INI file.
  8124.  
  8125.           With Windows 3.0 you can also install Command Post as your primary
  8126.           shell.  Perhaps you want to save memory, or avoid having to deal
  8127.           with Windows' Program Manager.  It's easy:
  8128.           Using the Notepad editor, edit the SYSTEM.INI file found in your
  8129.           Windows directory.  A few lines down from the top you will find a
  8130.           line that reads (as shipped by Microsoft)
  8131.  
  8132.           shell=progman.exe
  8133.  
  8134.           Change this line to:
  8135.           shell=cmdpost.exe
  8136.  
  8137.           Save the file and restart Windows.  Command Post will now appear in
  8138.           place of Program Manager.
  8139.  
  8140.  
  8141.  
  8142.  
  8143.  
  8144.  
  8145.  
  8146.  
  8147.  
  8148.  
  8149.  
  8150.  
  8151.  
  8152.  
  8153.  
  8154.  
  8155.  
  8156.  
  8157.  
  8158.  
  8159.  
  8160.  
  8161.  
  8162.  
  8163.  
  8164.                                                                            145
  8165.  
  8166.                                    APPENDIX B    Command Post  and Windows 3.0
  8167.  
  8168.  
  8169.  
  8170.           The Windows 3.0 Task Manager
  8171.           Windows 3.0 uses a special program called the Task Manager
  8172.           (TASKMAN.EXE).  The Task Manager is invoked whenever you do any of
  8173.           the following:
  8174.           1)  Press CTRL-ESC
  8175.           2)  Select Switch To... from the system menu of any application
  8176.           3)  Doubleclick on the screen background with the mouse.
  8177.  
  8178.           The Task Manager supplied with Windows brings up a dialog box which
  8179.           lets you choose which window to go to.
  8180.  
  8181.           Command Post gives you most of Task Manager's functionality.  For
  8182.           this reason, we have supplied a replacement TASKMAN.EXE with which
  8183.           you can replace Microsoft's version.  Our Task Manager will simply
  8184.           bring up Command Post.
  8185.           To replace Microsoft's TASKMAN.EXE with ours:
  8186.  
  8187.           1)  Rename Microsoft's TASKMAN.EXE to something different, such as
  8188.              TASKMANG.EXE.
  8189.           2)  Copy the TASKMAN.EXE from the Command Post installation
  8190.              directory to your Windows directory.
  8191.  
  8192.           This procedure is done automatically in the Command Post
  8193.           installation program if you choose the appropriate options.
  8194.           Windows' Task Manager has one feature that Command Post lacks:  In
  8195.           some instances it lets you shut down otherwise recalcitrant
  8196.           programs with the End Task button.  You might want to keep Windows'
  8197.           Task Manager as a Command Post menu item:
  8198.  
  8199.           &Utilities
  8200.            &Task Manager
  8201.              Run ("Taskmang.exe", "")
  8202.  
  8203.  
  8204.  
  8205.  
  8206.  
  8207.  
  8208.  
  8209.  
  8210.  
  8211.  
  8212.  
  8213.  
  8214.  
  8215.  
  8216.  
  8217.  
  8218.  
  8219.  
  8220.                                                                            146
  8221.  
  8222.                                         APPENDIX C    CPML  Programming Tricks
  8223.  
  8224.  
  8225.                                        APPENDIX C
  8226.  
  8227.                                           CPML
  8228.                                    Programming Tricks
  8229.  
  8230.  
  8231.  
  8232.           Fun With Filenames
  8233.           Sometimes you need to take a pathname and extract the drive letter,
  8234.           directory path, or filename from it.  The CPML string functions
  8235.           help you do this.
  8236.  
  8237.           Getting the drive letter is relatively easy.  Just make sure
  8238.           there's a colon in the pathname in at least the second character
  8239.           position.  If there is, take the character just before it:
  8240.              FullPath = AskLine ("", "Enter a full pathname", "")
  8241.              ColonIsAt= StrIndex(FullPath, ":",1, @FWDSCAN)
  8242.              ;if no colon or is first char, return "" drive letter:
  8243.              LetterLen = Min (Max (ColonIsAt-1, 1), 0)
  8244.              DriveLetter = StrSub(FullPath, ColonIsAt-1, 1)
  8245.              Drop (ColonIsAt, LetterLen)
  8246.  
  8247.           The colon could come later than position #2 if the pathname
  8248.           includes a network address before the drive letter.
  8249.  
  8250.           Getting the directory path is accomplished by finding the last
  8251.           backslash character and taking everything before that point.  Note
  8252.           when using StrIndex to search backwards from the end of a string,
  8253.           we use a start position of 0:
  8254.              Slash= StrIndex (FullPath, "\", 0,   @BACKSCAN)
  8255.              DirPath = StrSub (FullPath, 1, Slash-1)
  8256.              Drop (Slash)
  8257.  
  8258.           The filename is extracted in a similar manner:
  8259.  
  8260.              Slash = StrIndex (FullPath, "\",     0,   @BACKSCAN)
  8261.              FName = StrSub (FullPath, Slash+1,
  8262.                                    StrLen(FullPath)    -Slash)
  8263.              Drop (Slash)
  8264.  
  8265.           Once you have a filename you can extract its root.  First find the
  8266.           dot.  If there isn't any, proceed as if it was at the end.  In
  8267.           either case take the portion of the filename before the dot:
  8268.              DotIsAt = StrIndex (FileName,".",0,@FWDSCAN)
  8269.              DotIsAt = DotIsAt*(DotIsAt!=0)
  8270.                             + (StrLen(FileName)+1)*(DotIsAt==0)
  8271.              RootFileName=StrSub (FileName,1,DotIsAt-1)
  8272.              Drop (DotIsAt)
  8273.  
  8274.  
  8275.  
  8276.                                                                            147
  8277.  
  8278.                                         APPENDIX C    CPML  Programming Tricks
  8279.  
  8280.           Getting the extension is easier:
  8281.              DotIsAt = StrIndex (FileName,".",0,@FWDSCAN)
  8282.              Terminate (DotIsAt==0,"","File has no extension")
  8283.              Ext= StrSub (FileName, DotIsAt+1, StrLen(FileName)-DotIsAt)
  8284.              Drop (DotIsAt)
  8285.  
  8286.  
  8287.           Making a Free-Floating Menu
  8288.           The Command Post directory window, coupled with the default menu in
  8289.           CMDPOST.CPM, provides you with a more-useful file manager than is
  8290.           provided by Windows version 2.x.  However there are times when all
  8291.           you'd rather see is your custom menu bar without the directory
  8292.           listing, perhaps nestled down at the lower-right hand corner of the
  8293.           screen.
  8294.  
  8295.           This can be done rather easily in the initialization section of
  8296.           your custom menu file with the WinPlace command:
  8297.              ThisWin = WinGetActive()
  8298.              WinTitle (ThisWin, "Jenny's Favorites")
  8299.              ;get these dimensions from WININFO.EXE:
  8300.              WinPlace (710,872,1000,966,"Jenny's Favorites")
  8301.  
  8302.  
  8303.           When a Program is Already Running
  8304.           When you launch a program from a menu and it's already running,
  8305.           some times you'd rather just activate the window that's running
  8306.           instead of invoking another instance of the same program:
  8307.  
  8308.           &Desktop
  8309.            &Clock
  8310.              ErrorMode (@OFF)      ; Turn Errors Off
  8311.              Terminate (WinActivate("Clock"),"","")    ; Already running
  8312.              ErrorMode (@CANCEL)      ; Re-enable default error mode
  8313.              Run ("Clock.exe","")
  8314.  
  8315.  
  8316.           Working With Lists
  8317.           When selecting a menu item to run an application program, you can
  8318.           choose a file for the program to open from among all the appropri-
  8319.           ate files in the current directory.  For example, assume we want to
  8320.           choose from among the .WRI files, and then run Windows Write with
  8321.           the one we highlighted.  If the user presses OK without selecting a
  8322.           file, we'll still run Write, but we won't open a file:
  8323.              HTab = Num2Char (09)
  8324.              WRIFiles = FileItemize("*.WRI")
  8325.              TheFile = ItemSelect(".WRI file,
  8326.                          or just OK for new file",WRIFiles, HTab)
  8327.              RunZoom ("Write.exe", TheFile)
  8328.              Drop (WRIFiles, TheFile, HTab)
  8329.  
  8330.  
  8331.  
  8332.                                                                            148
  8333.  
  8334.                                         APPENDIX C    CPML  Programming Tricks
  8335.  
  8336.           We don't have to restrict ourselves to a single wildcard when we
  8337.           itemize files.  And if we've set up an association between the file
  8338.           extensions we're itemizing on and the programs that create them, we
  8339.           don't have to restrict ourselves to a single program, either.
  8340.           For example, let's show a list of all our compressed files in the
  8341.           current directory, allow the user to choose one, and run the
  8342.           appropriate decompression program against it.  (This assumes we've
  8343.           set up associations between these extensions and their respective
  8344.           compression programs in WIN.INI's [Extensions] section):
  8345.  
  8346.           &Utilities
  8347.            &Compress a file
  8348.              Files = FileItemize ("*.ZIP *.LZH *.ARC *.PAK *.PKA")
  8349.              TheFile = ItemSelect ("Choose a File", FileList, " ")
  8350.              Run (TheFile,"")
  8351.              Drop(FileList, TheFile)
  8352.  
  8353.           Of course, we don't have to itemize just by extension, either.  Any
  8354.           kind of wildcard will do.  We can even itemize full pathnames.
  8355.  
  8356.  
  8357.           Conditional Branching
  8358.           CPML does not have any branching statements.  The closest it comes
  8359.           to having an "if" statement is the Terminate function, which will
  8360.           end the menu item if a specified condition is true.
  8361.  
  8362.           However you can accomplish more useful conditional branching by
  8363.           using string manipulation and the powerful %substitution% feature
  8364.           of the language.
  8365.           Here's the basic technique:  Test your condition, negate it,  and
  8366.           use the result (@TRUE = 1 or @FALSE = 0) as the "length" parameter
  8367.           in a StrSub function to assign either a ";" or the zero-length null
  8368.           string "" to a variable.  Then, substitute this variable's contents
  8369.           into the beginning of each statement you want to execute when the
  8370.           condition is true.  When the condition you tested is true, the
  8371.           statements are executed normally.  But when the condition is false,
  8372.           a ";" is inserted at the beginning of the lines, making them com-
  8373.           ments and causing those statements to be ignored!
  8374.  
  8375.  
  8376.           Example:
  8377.           You prefer Notepad for simple text editing.  But it can't handle
  8378.           files longer than approximately 50,000 bytes in Windows 3.0 (17,000
  8379.           in Windows 2.x).  So let's call Word for Windows if our file is too
  8380.           long:
  8381.  
  8382.  
  8383.  
  8384.  
  8385.  
  8386.  
  8387.  
  8388.                                                                            149
  8389.  
  8390.                                         APPENDIX C    CPML  Programming Tricks
  8391.  
  8392.           &Word Processing
  8393.            &Simple Editing
  8394.              ;assuming MyFile contains the filename we want...
  8395.              TooBig = !(FileSize(MyFile) > 49000)
  8396.              IfTooBig    = strsub(";",1, TooBig)
  8397.              IfNotTooBig = strsub(";",1,!TooBig)
  8398.  
  8399.              execute %IfNotTooBig% RunZoom ("Notepad",           MyFile)
  8400.              execute %IfTooBig%    RunZoom ("D:\winword\WinWord",MyFile)
  8401.  
  8402.           Be sure to use the Execute command in front of the substituted
  8403.           variable, or else you will encounter an error.
  8404.           If these capabilities aren't powerful enough for your needs, you
  8405.           may want to consider having the menu item call a PubTech BatchWorks
  8406.           batch program.  The BatchWorks language is upwardly-compatible with
  8407.           CPML (and in fact was also written by us).
  8408.  
  8409.           BatchWorks creates free-standing batch files within which you can
  8410.           have conditionals, loops, subroutines, and extensive dialog boxes
  8411.           defined in addition to the standard CPML functions and commands
  8412.           described here.
  8413.           A BatchWorks file can also be invoked directly from the Windows
  8414.           v3.0 Program Manager.
  8415.  
  8416.  
  8417.  
  8418.           The Command Post Clock
  8419.           The Command Post package includes a screen blanker/clock
  8420.           application.  The executable is called CP_BLNK.EXE, and is used in
  8421.           the default CMDPOST.CPM menu.
  8422.           CP_BLNK.EXE takes one parameter, which is the minutes to delay
  8423.           before blanking the screen.  The parameter may be a positive, zero,
  8424.           or negative number:
  8425.  
  8426.              Screen         Clock       Clock Off
  8427.             Blanking      Displayed
  8428.                         Positive      Negative
  8429.           ON            number        number
  8430.  
  8431.                         Zero          Don't run
  8432.           OFF                         CP_BLNK.EXE
  8433.  
  8434.           Examples:
  8435.              Run("cp_blnk.exe",5)  ; Display clock.  Blank in 5 minutes.
  8436.              Run("cp_blnk.exe",0)  ; Display clock.  Never Blank.
  8437.              Run("cp_blnk.exe",-5) ; No clock.       Blank in 5 minutes.
  8438.  
  8439.           If you start the blanker with a zero or positive number, a clock
  8440.           will appear in the lower right of the screen.  Initially the clock
  8441.           will merely display the Command Post version number.  See pg. 23
  8442.           for how to use the Clock once it's onscreen.
  8443.  
  8444.                                                                            150
  8445.  
  8446.                                             APPENDIX D    Predefined Constants
  8447.  
  8448.  
  8449.                                        APPENDIX D
  8450.  
  8451.                                   Predefined Constants
  8452.  
  8453.           CPML provides you with a number of predefined integer constants to
  8454.           help make your menus more mnemonic:
  8455.  
  8456.           Logical Conditions                 String Handling
  8457.           @FALSE                             @FWDSCAN
  8458.           @NO                                @BACKSCAN
  8459.           @OFF
  8460.           @TRUE                              Menu Handling
  8461.           @YES                               @ENABLE
  8462.           @ON                                @DISABLE
  8463.                                              @UNCHECK
  8464.           Window Arranging                   @CHECK
  8465.           @NORESIZE                          System Control
  8466.           @ABOVEICONS                        @MAJOR
  8467.           @STACK                             @MINOR
  8468.           @ARRANGE
  8469.           @TITLE                             Error Handling
  8470.           @ROWS                              @CANCEL
  8471.           @COLUMNS                           @NOTIFY
  8472.                                              @OFF
  8473.  
  8474.  
  8475.  
  8476.  
  8477.  
  8478.  
  8479.  
  8480.  
  8481.  
  8482.  
  8483.  
  8484.  
  8485.  
  8486.  
  8487.  
  8488.  
  8489.  
  8490.  
  8491.  
  8492.  
  8493.  
  8494.  
  8495.  
  8496.  
  8497.  
  8498.  
  8499.  
  8500.                                                                            151
  8501.  
  8502.                                                           APPENDIX E    Errors
  8503.  
  8504.  
  8505.                                        APPENDIX E
  8506.  
  8507.                                          Errors
  8508.  
  8509.           If the current error mode is @CANCEL (the default), any CPML errors
  8510.           encountered while processing a menu item cause the item to be
  8511.           cancelled with an error message.
  8512.  
  8513.  
  8514.  
  8515.           Minor Errors
  8516.           Minor errors are ignored if the current error mode has been set to
  8517.           @OFF.  If the error mode is @NOTIFY the user has the option of
  8518.           continuing with the menu item or cancelling it.
  8519.           1006 File Copy/Move: No matching files found
  8520.           1017 File Delete: No matching files found
  8521.           1018 File Delete: Delete Failed
  8522.           1024 File Rename: No matching files found
  8523.           1025 File Rename: Rename failed
  8524.           1028 LogDisk: Requested drive not online
  8525.           1029 DirMake: Dir not created
  8526.           1030 DirRemove: Dir not removed
  8527.           1031 DirChange: Dir not found/changed
  8528.           1039 WinClose: Window not found
  8529.           1040 WinHide: Window not found
  8530.           1041 WinIconize: Window not found
  8531.           1042 WinZoom: Window not found
  8532.           1043 WinShow: Window not found
  8533.           1044 WinPlace: Window not found
  8534.           1045 WinActivate: Window not found
  8535.  
  8536.  
  8537.           Moderate Errors
  8538.           If the error mode is @NOTIFY or @OFF, the user has the option of
  8539.           continuing with the menu item or cancelling it.
  8540.  
  8541.           2002 File Copy/Move: 'From' file illegal
  8542.           2003 File Copy/Move: 'To'   file illegal
  8543.           2004 File Copy/Move: Cannot copy/move wildcards into fixed root
  8544.           2005 File Copy/Move: Cannot copy/move wildcards into fixed
  8545.                extension
  8546.           2007 File Move: Unable to rename source file
  8547.           2015 File Move:  Unable to remove source file
  8548.           2016 File Delete: File name illegal
  8549.           2019 File Rename: 'From' file illegal
  8550.           2020 File Rename: 'To' file illegal
  8551.           2021 File Rename: Attempt to rename across drive boundary. - Use
  8552.                MOVE instead.
  8553.           2022 File Rename: Cannot rename wildcards into a fixed filename
  8554.                root
  8555.  
  8556.                                                                            153
  8557.  
  8558.                                                           APPENDIX E    Errors
  8559.  
  8560.           2023 File Rename: Cannot rename wildcards into a fixed filename
  8561.                extension
  8562.           2038 WinCloseNot Function Syntax error
  8563.           2058 StrCat function syntax error
  8564.           2060 Average function syntax error
  8565.           2105 SetDisplay: Display type not SHORT or LONG
  8566.           2106 SetDisplay: Sort Type not NAME, DATE, SIZE, KIND, or UNSORTED
  8567.  
  8568.  
  8569.           Fatal Errors
  8570.           Fatal errors cause the current menu item to be cancelled with an
  8571.           error message, regardless of the error mode in effect.  (We show
  8572.           the error codes here for consistency, but in practice you will
  8573.           never be able to call LastError after a fatal error.)
  8574.           3008 File Copy/Move: 'From' file open error
  8575.           3011 File Copy/Move: 'From' file length error
  8576.           3012 File Copy/Move: No room left on disk.  Out of space??
  8577.           3013 File Copy/Move: 'To' file open error
  8578.           3014 File Copy/Move: I/O Error
  8579.           3026 LogDisk: Illegal disk drive
  8580.           3027 LogDisk: DOS reports no disks!!  ???
  8581.           3034 Clipboard owned by another app.  Cannot open.
  8582.           3035 Clipboard does not contain text for ClipAppend.
  8583.           3036 Clipboard cannot hold that much text (>64000 bytes)
  8584.           3037 Unable to allocate memory for clipboard.  Close some
  8585.                applications
  8586.           3046 Internal Error 3046. Function not defined
  8587.           3047 Variable name over 30 chars. Too Long
  8588.           3048 Substitution %Variable% not followed by a % (Use %% for %)
  8589.           3049 No variables exist??!!
  8590.           3050 Undefined variable
  8591.           3051 Undefined variable or function
  8592.           3052 Uninitialized variable or undefined function
  8593.           3053 Character string too long (>256 chars??)
  8594.           3054 Unrecognizable item found on line
  8595.           3055 Variable name is over 30 chars. Too Long
  8596.           3056 Variable could not be converted to string
  8597.           3057 Variable could not be converted to integer
  8598.           3059 Illegal Bounds for StrSub function
  8599.           3061 Illegal Syntax
  8600.           3062 Attempt to divide by zero
  8601.           3063 Internal Error 3063. Binary op not found
  8602.           3064 Internal Error 3064. Unary op not found
  8603.           3065 Unbalanced Parenthesis
  8604.           3066 Wrong Number of Arguments in Function
  8605.           3067 Function Syntax. Opening parenthesis missing.
  8606.           3068 Function Syntax. Illegal delimiter found.
  8607.           3069 Illegal assignment statement. (Use == for equality testing)
  8608.           3070 Internal error 3070.  Too many arguments defined.
  8609.           3071 Missing or incomplete statement
  8610.           3074 Expression continues past expected end.
  8611.  
  8612.                                                                            154
  8613.  
  8614.                                                           APPENDIX E    Errors
  8615.  
  8616.           3081 FileRead: Invalid file handle
  8617.           3082 FileRead: File not currently open
  8618.           3084 FileWrite: Invalid file handle
  8619.           3085 FileWrite: File not currently open
  8620.           3087 FileRead:  File not open for reading
  8621.           3088 FileRead: Attempt to read past end of file
  8622.           3089 FileWrite: File not open for writing
  8623.           3095 Compare could not be resolved into a integer or string compare
  8624.           3096 Memory allocation failure.  Out of memory for string storage
  8625.           3097 Memory allocation failure.  Out of memory for variable storage
  8626.           3098 Internal error, NULL pointer passed to xstrxxx subroutines
  8627.           3100 StrIndex/StrScan 3rd parameter out of bounds
  8628.           3101 Substituted line too long. (> 256 characters)
  8629.           3102 Drop: Can only drop variables
  8630.           3103 IsDefined: Attempting to test non-variables item
  8631.           3107 Run:  Filetype is not COM, EXE, PIF or BAT
  8632.           3108 FileItemize: Unable to lock file info segment
  8633.           3109 FileItemize: Unable to unlock file info segment
  8634.           3110 FileItemize: Unable to lock file index segment
  8635.           3111 FileItemize: Unable to unlock file index segment
  8636.           3112 FileSize:  File Not Found
  8637.           3113 FileSize:  Filelength I/O Error
  8638.           3114 FileSize:  Buffer Overrun Error
  8639.           3115 FileDelete: Buffer Overrun Error
  8640.           3116 FileRename: Buffer Overrun Error
  8641.           3117 FileCopyMove: Buffer Overrun Error
  8642.           3118 FileCopyMove: Destination file same as source
  8643.  
  8644.  
  8645.  
  8646.  
  8647.  
  8648.  
  8649.  
  8650.  
  8651.  
  8652.  
  8653.  
  8654.  
  8655.  
  8656.  
  8657.  
  8658.  
  8659.  
  8660.  
  8661.  
  8662.  
  8663.  
  8664.  
  8665.  
  8666.  
  8667.  
  8668.                                                                            155
  8669.  
  8670.                                                                          Index
  8671.  
  8672.  
  8673.                                          Index
  8674.  
  8675.                                              Display  42,73-74
  8676.           #                                  Drop  46,74-75
  8677.           #NextFile  103-104
  8678.                                              E
  8679.           A                                  EndSession  46,75-76
  8680.           Abs  45,52                         Environment  46,76-77
  8681.           AskLine  29,42,52-54               ErrorMode  46,77-78
  8682.           AskYesNo  29,42,54-55              Errors  41-42,157-160
  8683.           Average  45,55-56                    fatal  158-160
  8684.                                                minor  157
  8685.           B                                    moderate  157-158
  8686.           Beep  42,56-57                       see also   Debug, ErrorMode,
  8687.                                                LastError
  8688.           C                                  Execute  46,78-79
  8689.           Char2Num  45,57-58                 Exit  46,79-80
  8690.           ClipAppend  46,58-59
  8691.           ClipGet  46,59-60                  F
  8692.           ClipPut  46,60-61                  File Management
  8693.           Clock, Command Post                  default "File" menu  6-12
  8694.             default action  23                 in CPML  42-43
  8695.             in CPML  154                     FileCopy  42,80-81
  8696.           cmdpost.cpm  3,25                  FileDelete  43,81-82
  8697.             and #NextFile  104               FileExist  43,82-83
  8698.           cmduser.cpm  3,25                  FileItemize  43,83-84
  8699.             and #NextFile  104               FileLocate  43,84-85
  8700.           Comments  39                       FileMove  43,85-86
  8701.           Conditional Branching  153         FileRename  43,86-87
  8702.             see also   Terminate             FileSize  43,87-88
  8703.           Constants  36-37
  8704.             predefined  37                   H
  8705.           CurrentFile  31,42,61-62           Housekeeping
  8706.                                                "Main" menu  16-21
  8707.           D
  8708.           DateTime  46,62-63                 I
  8709.           Debug  46,63-65                    Identifiers  37
  8710.           Delay  46,65-66                    IniRead  46,88-89
  8711.           DirChange  31,43,66-67             IniWrite  46,89-90
  8712.           Directives  41                     IsDefined  46,90-91
  8713.             see also   #NextFile             IsMenuChecked  44,91-92
  8714.           Directory Management               IsMenuEnabled  44,92-93
  8715.             default "Dir" menu  12-14        IsNumber  45,93-94
  8716.             in CPML  43                      IsRunning  46,94-95
  8717.           DirGet  43,67-68                   ItemSelect  29,42,95-97
  8718.           DirHome  43,68-69
  8719.           DirItemize  43,69-70               J
  8720.           DirMake  43,70-71                  JELL-O  54
  8721.           DirRemove  43,71-72
  8722.           DiskFree  43,72-73                 K
  8723.  
  8724.                                                                            156
  8725.  
  8726.                                                                IndexIndexIndex
  8727.  
  8728.           Keywords  38                         as an icon  6
  8729.                                                in CPML  44-45
  8730.           L                                  RunZoom  28,44,112-113
  8731.           LastError  47,97-98
  8732.           LogDisk  43,98-99                  S
  8733.                                              Selecting files  4-6
  8734.           M                                  SetDisplay  47,113-114
  8735.           Max  45,99-100                     Statements  39-40
  8736.           menu files  25-31                    reference  47-146
  8737.             CPML language components  36-41  StrCat  45,114-115
  8738.             error handling  41-42            StrCmp  45,115-116
  8739.             menu structure  35               StrFill  45,116-117
  8740.             menuitems  35-36                 StrFix  45,117-118
  8741.             reloading changes  21-22         StrICmp  45,118-119
  8742.             second file  103-104             StrIndex  45,119-120
  8743.             statement summary  42-47         StrLen  45,120-121
  8744.             statements  47-146               StrLower  45,121-122
  8745.           MenuChange  44,100-101             StrScan  45,122-123
  8746.           Message  30,42,101-102             StrSub  45,123-124
  8747.           Microsoft Windows                  StrTrim  45,124-125
  8748.             date & time formatting  63       StrUpper  45,125-126
  8749.             determining the version          Substitution  40-41
  8750.             47,141-142                         and StrCat  114-115
  8751.             ending the session  11           System Menu  21-22
  8752.             version 2.x
  8753.              ending the session  76          T
  8754.              MS-DOS Executive  3             Terminate  30,42,47,126-128
  8755.             version 3.0                      TextBox  42,128-129
  8756.              ending the session  76
  8757.           Min  46,102-103                    V
  8758.                                              Variables  37-38
  8759.           N                                  Version  47,129
  8760.           Num2Char  45,102-105               Views
  8761.                                                default "View" menu  14-16
  8762.           O                                    see also   SetDisplay
  8763.           Operators  38-39
  8764.             Precedence  39                   W
  8765.           OtherDir  47,105-106               WinActivate  43,129-130
  8766.           OtherUpdate  47,106-107            WinArrange  43,130-132
  8767.                                              WinClose  44,132
  8768.           P                                  WinCloseNot  44,132-133
  8769.           Pause  30,42,107-108               Window Management
  8770.                                                in CPML  43-44
  8771.           R                                  WinGetActive  44,133-134
  8772.           Random  46,108-109                 WinHide  44,134-135
  8773.           Registration  21,163               WinIconize  44,135-136
  8774.           Run  28,44,109-110                 WinItemize  44,136-137
  8775.           RunHide  44,110-111                WinPlace  44,137-139
  8776.           RunIcon  28,44,111-112             WinShow  44,139-140
  8777.           Running programs                   WinTitle  44,140-141
  8778.             as a normal window  6            WinVersion  47,141-142
  8779.  
  8780.                                                                            157
  8781.  
  8782.  
  8783.  
  8784.           WinWaitClose  44,142-143           Yield  47,144-145
  8785.           WinZoom  44,143-144
  8786.  
  8787.           Y
  8788.  
  8789.  
  8790.  
  8791.  
  8792.  
  8793.  
  8794.  
  8795.  
  8796.  
  8797.  
  8798.  
  8799.  
  8800.  
  8801.  
  8802.  
  8803.  
  8804.  
  8805.  
  8806.  
  8807.  
  8808.  
  8809.  
  8810.  
  8811.  
  8812.  
  8813.  
  8814.  
  8815.  
  8816.  
  8817.  
  8818.  
  8819.  
  8820.  
  8821.  
  8822.  
  8823.  
  8824.  
  8825.  
  8826.  
  8827.  
  8828.  
  8829.  
  8830.  
  8831.  
  8832.  
  8833.  
  8834.  
  8835.  
  8836.                                                                            158
  8837.